diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2018-08-20 22:58:26 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2018-08-20 22:58:26 +0200 |
commit | 77b736988cbaef25dc5ec50d775421394a4dc033 (patch) | |
tree | ffd9b76eaa945647515352b21ae6c9f436437cc0 | |
parent | 4b131434d53e52b7127557d09311b119611f7b9f (diff) |
Check cache last modified after existence verification
-rw-r--r-- | main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |