Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: base/time/time.h

Issue 1989403003: Remove unnecessary 'inline's on constexpr TimeDelta functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time.h
diff --git a/base/time/time.h b/base/time/time.h
index bcc9031e222e795df3283ff8b616455a0a749c02..399ec826ce375e2adeeb5c8b58b1a9aeef18edb8 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -579,56 +579,54 @@ class BASE_EXPORT Time : public time_internal::TimeBase<Time> {
Time* parsed_time);
};
-// Inline the TimeDelta factory methods, for fast TimeDelta construction.
-
// static
-constexpr inline TimeDelta TimeDelta::FromDays(int days) {
+constexpr TimeDelta TimeDelta::FromDays(int days) {
return days == std::numeric_limits<int>::max()
? Max()
: TimeDelta(days * Time::kMicrosecondsPerDay);
}
// static
-constexpr inline TimeDelta TimeDelta::FromHours(int hours) {
+constexpr TimeDelta TimeDelta::FromHours(int hours) {
return hours == std::numeric_limits<int>::max()
? Max()
: TimeDelta(hours * Time::kMicrosecondsPerHour);
}
// static
-constexpr inline TimeDelta TimeDelta::FromMinutes(int minutes) {
+constexpr TimeDelta TimeDelta::FromMinutes(int minutes) {
return minutes == std::numeric_limits<int>::max()
? Max()
: TimeDelta(minutes * Time::kMicrosecondsPerMinute);
}
// static
-constexpr inline TimeDelta TimeDelta::FromSeconds(int64_t secs) {
+constexpr TimeDelta TimeDelta::FromSeconds(int64_t secs) {
return FromProduct(secs, Time::kMicrosecondsPerSecond);
}
// static
-constexpr inline TimeDelta TimeDelta::FromMilliseconds(int64_t ms) {
+constexpr TimeDelta TimeDelta::FromMilliseconds(int64_t ms) {
return FromProduct(ms, Time::kMicrosecondsPerMillisecond);
}
// static
-constexpr inline TimeDelta TimeDelta::FromSecondsD(double secs) {
+constexpr TimeDelta TimeDelta::FromSecondsD(double secs) {
return FromDouble(secs * Time::kMicrosecondsPerSecond);
}
// static
-constexpr inline TimeDelta TimeDelta::FromMillisecondsD(double ms) {
+constexpr TimeDelta TimeDelta::FromMillisecondsD(double ms) {
return FromDouble(ms * Time::kMicrosecondsPerMillisecond);
}
// static
-constexpr inline TimeDelta TimeDelta::FromMicroseconds(int64_t us) {
+constexpr TimeDelta TimeDelta::FromMicroseconds(int64_t us) {
return TimeDelta(us);
}
// static
-constexpr inline TimeDelta TimeDelta::FromDouble(double value) {
+constexpr TimeDelta TimeDelta::FromDouble(double value) {
// TODO(crbug.com/612601): Use saturated_cast<int64_t>(value) once we sort out
// the Min() behavior.
return value > std::numeric_limits<int64_t>::max()
@@ -639,8 +637,8 @@ constexpr inline TimeDelta TimeDelta::FromDouble(double value) {
}
// static
-constexpr inline TimeDelta TimeDelta::FromProduct(int64_t value,
- int64_t positive_value) {
+constexpr TimeDelta TimeDelta::FromProduct(int64_t value,
+ int64_t positive_value) {
return (DCHECK(positive_value > 0),
value > std::numeric_limits<int64_t>::max() / positive_value
? Max()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698