OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/rtc_base/time_interval.h" | |
12 #include "webrtc/rtc_base/timeutils.h" | |
13 | |
14 namespace rtc { | |
15 | |
16 TimeInterval::TimeInterval() {} | |
ossu
2017/07/14 11:13:15
= default instead of {}
saza WebRTC
2017/07/17 14:27:29
Done.
| |
17 TimeInterval::~TimeInterval() {} | |
ossu
2017/07/14 11:13:15
Same here.
saza WebRTC
2017/07/17 14:27:29
Done.
| |
18 | |
19 void TimeInterval::Extend() { | |
20 Extend(TimeMillis()); | |
21 } | |
22 | |
23 void TimeInterval::Extend(int64_t time) { | |
24 if (!first_ || time < *first_) { | |
ossu
2017/07/14 11:13:15
Just a minor detail, but first_ and last_ aren't b
ossu
2017/07/14 15:37:32
Rietveld top-tip: If you reply to the comments ind
saza WebRTC
2017/07/17 14:27:29
Oh, thanks for the tip!
| |
25 first_.emplace(time); | |
26 } | |
27 if (!last_ || *last_ < time) { | |
28 last_.emplace(time); | |
29 } | |
30 } | |
31 | |
32 bool TimeInterval::Empty() const { | |
33 return !first_; | |
34 } | |
35 | |
36 Optional<int64_t> TimeInterval::First() const { | |
37 return first_; | |
38 } | |
39 | |
40 Optional<int64_t> TimeInterval::Last() const { | |
41 return last_; | |
42 } | |
43 | |
44 } // namespace rtc | |
OLD | NEW |