diff options
author | Kelvin Zhang <zhangkelvin@google.com> | 2020-09-10 10:39:30 -0400 |
---|---|---|
committer | Kelvin Zhang <zhangkelvin@google.com> | 2020-09-17 00:18:23 +0000 |
commit | 176ddafbddc7c8b9ac8d52c7620f75a94d3cb331 (patch) | |
tree | a846ad89b7e7eef87872abac205073d78ef43b8b | |
parent | 167178355a8d680ffd38ecb7493e525c4849444d (diff) | |
download | libchrome-176ddafbddc7c8b9ac8d52c7620f75a94d3cb331.tar.gz |
Use default copy constructor for base::TimeDelta
The previously hand written constructor does the same thing as default
copy constructor/copy assignment operator. So use default.
Test: mm -j
Change-Id: I85d743b43ed564dd2adeda5bd050321f6c73cebc
-rw-r--r-- | base/time/time.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/base/time/time.h b/base/time/time.h index b3c77e7289..ba7be4b8c4 100644 --- a/base/time/time.h +++ b/base/time/time.h @@ -199,10 +199,8 @@ class BASE_EXPORT TimeDelta { double InMicrosecondsF() const; int64_t InNanoseconds() const; - constexpr TimeDelta& operator=(TimeDelta other) { - delta_ = other.delta_; - return *this; - } + constexpr TimeDelta& operator=(const TimeDelta&) = default; + constexpr TimeDelta(const TimeDelta&) = default; // Computations with other deltas. Can easily be made constexpr with C++17 but // hard to do until then per limitations around |