diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-05-16 00:36:43 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-05-16 21:39:01 +0200 |
| commit | 78189e9211907aee322f647f333ced87c5140247 (patch) | |
| tree | 73e1b54e6898e3ea9cf9b91b38ad42d039420ee3 /src/lib/dcpomatic_time.h | |
| parent | 194ec286939aba7b0cf24762d03ce6ebfe0b9a9f (diff) | |
Give subtract() lists for both parameters.
Diffstat (limited to 'src/lib/dcpomatic_time.h')
| -rw-r--r-- | src/lib/dcpomatic_time.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/dcpomatic_time.h b/src/lib/dcpomatic_time.h index 9e7191b1e..57ffb1faf 100644 --- a/src/lib/dcpomatic_time.h +++ b/src/lib/dcpomatic_time.h @@ -342,14 +342,13 @@ public: }; -/** @param A Period which is subtracted from. +/** @param A Periods which are subtracted from, must be in ascending order of start time and must not overlap. * @param B Periods to subtract from `A', must be in ascending order of start time and must not overlap. */ template <class T> -std::list<TimePeriod<T>> subtract (TimePeriod<T> A, std::list<TimePeriod<T>> const & B) +std::list<TimePeriod<T>> subtract (std::list<TimePeriod<T>> const & A, std::list<TimePeriod<T>> const & B) { - std::list<TimePeriod<T>> result; - result.push_back (A); + std::list<TimePeriod<T>> result = A; for (auto i: B) { std::list<TimePeriod<T>> new_result; |
