From 77b736988cbaef25dc5ec50d775421394a4dc033 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 20 Aug 2018 22:58:26 +0200 Subject: Check cache last modified after existence verification --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 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; } -- cgit v1.2.3-70-g09d2