summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-08-20 22:58:26 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-08-20 22:58:26 +0200
commit77b736988cbaef25dc5ec50d775421394a4dc033 (patch)
treeffd9b76eaa945647515352b21ae6c9f436437cc0
parent4b131434d53e52b7127557d09311b119611f7b9f (diff)
Check cache last modified after existence verification
-rw-r--r--main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index 89bae51..f2d0664 100644
--- a/main.cpp
+++ b/main.cpp
@@ -174,11 +174,11 @@ static string gameLogPath(const Player &p1, const Player &p2, int index) {
static optional<MatchResult> readMatchCache(const Player &p1, const Player &p2, int index) {
string path = matchCachePath(p1, p2, index);
- int64_t cacheStamp = fileLastModified(path);
ifstream f(path);
if (!f) return nullopt;
+ int64_t cacheStamp = fileLastModified(path);
if (p1.lastModified > cacheStamp || p2.lastModified > cacheStamp) {
return nullopt;
}