Optimize updateFastFaceRow processing by removing some TileSpec copy (#5678)
[oweals/minetest.git] / src / porting.cpp
index 9d859da7da8d5832e960fcb7e5d93e9b752318b9..10b6fc94059c675af85165b669e65518bd606611 100644 (file)
@@ -408,7 +408,7 @@ bool setSystemPaths()
 #endif
 
        for (std::list<std::string>::const_iterator
-                       i = trylist.begin(); i != trylist.end(); i++) {
+                       i = trylist.begin(); i != trylist.end(); ++i) {
                const std::string &trypath = *i;
                if (!fs::PathExists(trypath) ||
                        !fs::PathExists(trypath + DIR_DELIM + "builtin")) {
@@ -942,5 +942,18 @@ void attachOrCreateConsole(void)
 #endif
 }
 
+// Load performance counter frequency only once at startup
+#ifdef _WIN32
+
+inline double get_perf_freq()
+{
+       LARGE_INTEGER freq;
+       QueryPerformanceFrequency(&freq);
+       return freq.QuadPart;
+}
+
+double perf_freq = get_perf_freq();
+
+#endif
 
 } //namespace porting