summaryrefslogtreecommitdiff
path: root/AK/Time.h
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-07-31 16:20:05 -0700
committerAndreas Kling <kling@serenityos.org>2021-08-03 18:44:01 +0200
commit2dd6d2121ad51d16e55454679707a861784af92e (patch)
tree955316d9488c1fb9747f82fed2437be44ac6b3e6 /AK/Time.h
parent8f552c9979d92aead2589c8fb3a6d9298faa5603 (diff)
downloadserenity-2dd6d2121ad51d16e55454679707a861784af92e.zip
AK: Mark Time::max() / Time::min() / Time::zero() as constexpr
No reason for these static helper functions to not be constexpr.
Diffstat (limited to 'AK/Time.h')
-rw-r--r--AK/Time.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/AK/Time.h b/AK/Time.h
index 9cc61321fd..8a754ab0ff 100644
--- a/AK/Time.h
+++ b/AK/Time.h
@@ -139,9 +139,9 @@ public:
}
static Time from_timespec(const struct timespec&);
static Time from_timeval(const struct timeval&);
- static Time min() { return Time(-0x8000'0000'0000'0000LL, 0); };
- static Time zero() { return Time(0, 0); };
- static Time max() { return Time(0x7fff'ffff'ffff'ffffLL, 999'999'999); };
+ constexpr static Time min() { return Time(-0x8000'0000'0000'0000LL, 0); };
+ constexpr static Time zero() { return Time(0, 0); };
+ constexpr static Time max() { return Time(0x7fff'ffff'ffff'ffffLL, 999'999'999); };
// Truncates towards zero (2.8s to 2s, -2.8s to -2s).
i64 to_truncated_seconds() const;