diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-15 12:40:53 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-21 11:22:11 -0800 |
commit | c33ed50c98c57ce2f2cf3b971bcf72c4208bf120 (patch) | |
tree | a45369f797029fa6a7a05511e3c4b051bede9a2a /src | |
parent | 1766d7dcbf9482ceac9bff37e0f7f5a4c60b9123 (diff) | |
download | qtlocation-mapboxgl-c33ed50c98c57ce2f2cf3b971bcf72c4208bf120.tar.gz |
[core] Eliminate Response::stale and inline Response::isExpired()
Response::isExpired() had subtle and potentially confusing behavior around Seconds::zero(). It's best to inline it and comment why.
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/storage/response.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/mbgl/storage/response.cpp b/src/mbgl/storage/response.cpp index b42fb211c8..22263d2ebb 100644 --- a/src/mbgl/storage/response.cpp +++ b/src/mbgl/storage/response.cpp @@ -9,7 +9,6 @@ Response::Response(const Response& res) { Response& Response::operator=(const Response& res) { error = res.error ? std::make_unique<Error>(*res.error) : nullptr; - stale = res.stale; notModified = res.notModified; data = res.data; modified = res.modified; @@ -18,11 +17,6 @@ Response& Response::operator=(const Response& res) { return *this; } -bool Response::isExpired() const { - // Note: expires == 0 also counts as expired! - return SystemTimePoint(expires) <= SystemClock::now(); -} - Response::Error::Error(Reason reason_, const std::string& message_) : reason(reason_), message(message_) { } |