summaryrefslogtreecommitdiff
path: root/src/mbgl/util/http_header.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-05-13 15:41:22 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-05-13 17:24:22 +0200
commitcd65a43855f33555eca5f3e3ad5d37661253209f (patch)
treed83b63f4baeb3672c4909a08b14783c717b74681 /src/mbgl/util/http_header.cpp
parentc1dde52c73061a49d576454a9ab4739e72561ca6 (diff)
downloadqtlocation-mapboxgl-cd65a43855f33555eca5f3e3ad5d37661253209f.tar.gz
[core] move from microsecond precision timestamp to integer second precision
Diffstat (limited to 'src/mbgl/util/http_header.cpp')
-rw-r--r--src/mbgl/util/http_header.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mbgl/util/http_header.cpp b/src/mbgl/util/http_header.cpp
index cfc43991b7..dceb331a3f 100644
--- a/src/mbgl/util/http_header.cpp
+++ b/src/mbgl/util/http_header.cpp
@@ -25,12 +25,8 @@ CacheControl CacheControl::parse(const std::string& value) {
return result;
}
-optional<SystemTimePoint> CacheControl::toTimePoint() const {
- // Round trip through time_t to truncate fractional seconds.
- return maxAge
- ? SystemClock::from_time_t(SystemClock::to_time_t(
- SystemClock::now() + std::chrono::seconds(*maxAge)))
- : optional<SystemTimePoint>();
+optional<Timestamp> CacheControl::toTimePoint() const {
+ return maxAge ? util::now() + Seconds(*maxAge) : optional<Timestamp>{};
}
} // namespace http