Skip to content

Commit

Permalink
Filesystem/Boost: range-for
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed May 11, 2018
1 parent f40b58c commit 051f923
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/filesystem_boost.cpp
Expand Up @@ -816,20 +816,20 @@ bool delete_directory(const std::string& dirname, const bool keep_pbl)
get_files_in_dir(dirname, &files, &dirs, ENTIRE_FILE_PATH, keep_pbl ? SKIP_PBL_FILES : NO_FILTER);

if(!files.empty()) {
for(std::vector<std::string>::const_iterator i = files.begin(); i != files.end(); ++i) {
bfs::remove(path(*i), ec);
for(const std::string& f : files) {
bfs::remove(path(f), ec);
if(ec) {
LOG_FS << "remove(" << (*i) << "): " << ec.message() << '\n';
LOG_FS << "remove(" << f << "): " << ec.message() << '\n';
ret = false;
}
}
}

if(!dirs.empty()) {
for(std::vector<std::string>::const_iterator j = dirs.begin(); j != dirs.end(); ++j) {
for(const std::string& d : dirs) {
// TODO: this does not preserve any other PBL files
// filesystem.cpp does this too, so this might be intentional
if(!delete_directory(*j))
if(!delete_directory(d))
ret = false;
}
}
Expand Down Expand Up @@ -1200,8 +1200,8 @@ void binary_paths_manager::cleanup()
{
binary_paths_cache.clear();

for(std::vector<std::string>::const_iterator i = paths_.begin(); i != paths_.end(); ++i) {
binary_paths.erase(*i);
for(const std::string& p : paths_) {
binary_paths.erase(p);
}
}

Expand Down

0 comments on commit 051f923

Please sign in to comment.