diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-11-02 01:26:13 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-11-02 01:26:13 +0000 |
| commit | d9a189571d94e656e137db115c1070ae161984ee (patch) | |
| tree | e4caa0f0735d9c840942ffa924755da7ef1cbfe6 /src/dcp_time.cc | |
| parent | 6d7dc1a2b650a74f23b772d215bb43d5f7b3e173 (diff) | |
Tidy operator<= for libdcp::Time somewhat. Change subtitles_at to subtitles_during as it's a better API for dcptocomps.
Diffstat (limited to 'src/dcp_time.cc')
| -rw-r--r-- | src/dcp_time.cc | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/dcp_time.cc b/src/dcp_time.cc index 9b93391b..428215cb 100644 --- a/src/dcp_time.cc +++ b/src/dcp_time.cc @@ -99,23 +99,7 @@ libdcp::operator!= (Time const & a, Time const & b) bool libdcp::operator<= (Time const & a, Time const & b) { - if (a.h != b.h) { - return a.h <= b.h; - } - - if (a.m != b.m) { - return a.m <= b.m; - } - - if (a.s != b.s) { - return a.s <= b.s; - } - - if (a.t != b.t) { - return a.t <= b.t; - } - - return true; + return a < b || a == b; } bool @@ -162,6 +146,12 @@ libdcp::operator> (Time const & a, Time const & b) return true; } +bool +libdcp::operator>= (Time const & a, Time const & b) +{ + return a == b || a > b; +} + ostream & libdcp::operator<< (ostream& s, Time const & t) { |
