Skip to content

Commit

Permalink
Use range-based for with const modificator.
Browse files Browse the repository at this point in the history
  • Loading branch information
intorr authored and Xottab-DUTY committed Dec 19, 2017
1 parent 87dafb1 commit 8ba48be
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/utils/xrCompress/xrCompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ bool xrCompressor::testSKIP(LPCSTR path)
if (0 == _stricmp(p_ext, ".rc"))
return true;

for (auto &it : exclude_exts)
for (const auto &it : exclude_exts)
if (PatternMatch(p_ext, it.c_str()))
return true;

Expand Down Expand Up @@ -430,7 +430,7 @@ void xrCompressor::PerformWork()
int pack_num = 0;
OpenPack(target_name.c_str(), pack_num++);

for (auto &it : *folders_list)
for (const auto &it : *folders_list)
write_file_header(it, 0, 0, 0, 0);

if (!bStoreFiles)
Expand Down Expand Up @@ -483,7 +483,7 @@ void xrCompressor::GatherFiles(LPCSTR path)
Msg("ERROR: Unable to open file list:%s", path);
return;
}
for (auto &it : *i_list)
for (const auto &it : *i_list)
{
xr_string tmp_path = xr_string(path) + xr_string(it);
if (!testSKIP(tmp_path.c_str()))
Expand All @@ -504,7 +504,7 @@ bool xrCompressor::IsFolderAccepted(CInifile& ltx, LPCSTR path, BOOL& recurse)
if (ltx.section_exist("exclude_folders"))
{
CInifile::Sect& ef_sect = ltx.r_section("exclude_folders");
for (auto &it : ef_sect.Data)
for (const auto &it : ef_sect.Data)
{
recurse = CInifile::isBool(it.second.c_str());
if (recurse)
Expand Down Expand Up @@ -535,7 +535,7 @@ void xrCompressor::ProcessLTX(CInifile& ltx)
if (ltx.section_exist("include_folders"))
{
CInifile::Sect& if_sect = ltx.r_section("include_folders");
for (auto &it : if_sect.Data)
for (const auto &it : if_sect.Data)
{
BOOL ifRecurse = CInifile::isBool(it.second.c_str());
u32 folder_mask = FS_ListFolders | (ifRecurse ? 0 : FS_RootOnly);
Expand Down Expand Up @@ -563,7 +563,7 @@ void xrCompressor::ProcessLTX(CInifile& ltx)
continue;
}

for (auto &it : *i_fl_list)
for (const auto &it : *i_fl_list)
{
xr_string tmp_path = xr_string(path) + xr_string(it);
bool val = IsFolderAccepted(ltx, tmp_path.c_str(), efRecurse);
Expand Down Expand Up @@ -592,7 +592,7 @@ void xrCompressor::ProcessLTX(CInifile& ltx)
if (ltx.section_exist("include_files"))
{
CInifile::Sect& if_sect = ltx.r_section("include_files");
for (auto &it : if_sect.Data)
for (const auto &it : if_sect.Data)
files_list->push_back(xr_strdup(it.first.c_str()));
}

Expand Down

0 comments on commit 8ba48be

Please sign in to comment.