From 55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b Mon Sep 17 00:00:00 2001 From: void_17 <61356189+void2012@users.noreply.github.com> Date: Fri, 6 Mar 2026 02:11:18 +0700 Subject: Remove AUTO_VAR macro and _toString function (#592) --- Minecraft.World/RegionFileCache.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'Minecraft.World/RegionFileCache.cpp') diff --git a/Minecraft.World/RegionFileCache.cpp b/Minecraft.World/RegionFileCache.cpp index 23c87118..2bb370a8 100644 --- a/Minecraft.World/RegionFileCache.cpp +++ b/Minecraft.World/RegionFileCache.cpp @@ -25,22 +25,22 @@ RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wst //File regionDir(basePath, L"region"); - //File file(regionDir, wstring(L"r.") + _toString(chunkX>>5) + L"." + _toString(chunkZ>>5) + L".mcr" ); + //File file(regionDir, wstring(L"r.") + std::to_wstring(chunkX>>5) + L"." + std::to_wstring(chunkZ>>5) + L".mcr" ); MemSect(31); File file; if(useSplitSaves(saveFile->getSavePlatform())) { - file = File( prefix + wstring(L"r.") + _toString(chunkX>>4) + L"." + _toString(chunkZ>>4) + L".mcr" ); + file = File( prefix + wstring(L"r.") + std::to_wstring(chunkX>>4) + L"." + std::to_wstring(chunkZ>>4) + L".mcr" ); } else { - file = File( prefix + wstring(L"r.") + _toString(chunkX>>5) + L"." + _toString(chunkZ>>5) + L".mcr" ); + file = File( prefix + wstring(L"r.") + std::to_wstring(chunkX>>5) + L"." + std::to_wstring(chunkZ>>5) + L".mcr" ); } MemSect(0); RegionFile *ref = NULL; - AUTO_VAR(it, cache.find(file)); - if( it != cache.end() ) + auto it = cache.find(file); + if( it != cache.end() ) ref = it->second; // 4J Jev, put back in. @@ -69,20 +69,14 @@ RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wst void RegionFileCache::_clear() // 4J - TODO was synchronized { - AUTO_VAR(itEnd, cache.end()); - for( AUTO_VAR(it, cache.begin()); it != itEnd; it++ ) + for(auto& it : cache) { - // 4J - removed try/catch -// try { - RegionFile *regionFile = it->second; + RegionFile *regionFile = it.second; if (regionFile != NULL) { regionFile->close(); } delete regionFile; -// } catch (IOException e) { -// e.printStackTrace(); -// } } cache.clear(); } -- cgit v1.2.3