Remove unit_base functions FromStaticX
instead make functions FromX constexpr and use them. Bug: None Change-Id: I826c8ad5ac8b3bd97f298a99c40b31b8c63b5f85 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159220 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30321}
This commit is contained in:
committed by
Commit Bot
parent
fae6f0e87b
commit
7356a5666d
@ -35,25 +35,25 @@ class TimeDelta final : public rtc_units_impl::RelativeUnit<TimeDelta> {
|
||||
TimeDelta() = delete;
|
||||
template <int64_t seconds>
|
||||
static constexpr TimeDelta Seconds() {
|
||||
return FromStaticFraction<seconds, 1000000>();
|
||||
return FromFraction(1'000'000, seconds);
|
||||
}
|
||||
template <int64_t ms>
|
||||
static constexpr TimeDelta Millis() {
|
||||
return FromStaticFraction<ms, 1000>();
|
||||
return FromFraction(1000, ms);
|
||||
}
|
||||
template <int64_t us>
|
||||
static constexpr TimeDelta Micros() {
|
||||
return FromStaticValue<us>();
|
||||
return FromValue(us);
|
||||
}
|
||||
template <typename T>
|
||||
static TimeDelta seconds(T seconds) {
|
||||
static_assert(std::is_arithmetic<T>::value, "");
|
||||
return FromFraction<1000000>(seconds);
|
||||
return FromFraction(1'000'000, seconds);
|
||||
}
|
||||
template <typename T>
|
||||
static TimeDelta ms(T milliseconds) {
|
||||
static_assert(std::is_arithmetic<T>::value, "");
|
||||
return FromFraction<1000>(milliseconds);
|
||||
return FromFraction(1000, milliseconds);
|
||||
}
|
||||
template <typename T>
|
||||
static TimeDelta us(T microseconds) {
|
||||
|
||||
Reference in New Issue
Block a user