# HG changeset patch # User rubidium # Date 2011-12-17 21:20:41 # Node ID 048fedb0b5f517b815898070b264c67998bad7ca # Parent 4348d1b1703613f2216cde8c45ce132465f501e2 (svn r23580) -Codechange: put the infrastructure maintenance cache testing behind the desync debug level guard, improving the game's speed significantly diff --git a/src/openttd.cpp b/src/openttd.cpp --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1119,6 +1119,10 @@ void SwitchToMode(SwitchMode new_mode) */ static void CheckCaches() { + /* Return here so it is easy to add checks that are run + * always to aid testing of caches. */ + if (_debug_desync_level <= 1) return; + /* Check company infrastructure cache. */ SmallVector old_infrastructure; Company *c; @@ -1135,10 +1139,6 @@ static void CheckCaches() i++; } - /* Return here so it is easy to add checks that are run - * always to aid testing of caches. */ - if (_debug_desync_level <= 1) return; - /* Strict checking of the road stop cache entries */ const RoadStop *rs; FOR_ALL_ROADSTOPS(rs) {