Skip to content

Commit 9ed96c5

Browse files
committed
xrGame/MainMenu.cpp: replace std::for_each with range-based for
1 parent 9d5e0fc commit 9ed96c5

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/xrGame/MainMenu.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,23 +189,15 @@ void CMainMenu::ReadTextureInfo()
189189

190190
const auto ParseFileSet = [&]()
191191
{
192-
/*
193-
* Original CoP textures_descr
194-
* loading time:
195-
* Single-threaded ~80 ms
196-
* Multi-threaded ~40 ms
197-
* Just a bit of speedup
198-
*/
199-
// tbb::parallel_for_each(files, [](const FS_File& file) // Cause memory corruption (detected by Valgrind)
200-
std::for_each(files.begin(), files.end(), [](const FS_File& file)
192+
for (const auto& file : files)
201193
{
202194
string_path path, name;
203195
_splitpath(file.name.c_str(), nullptr, path, name, nullptr);
204196
xr_strcat(name, ".xml");
205197
path[xr_strlen(path) - 1] = '\0'; // cut the latest '\\'
206198

207199
CUITextureMaster::ParseShTexInfo(path, name);
208-
});
200+
}
209201
};
210202

211203
UpdateFileSet(UI_PATH_DEFAULT);

0 commit comments

Comments
 (0)