void ForEach::finish()
{
- list<string> files = FS::list_files(base);
- for(list<string>::iterator i = files.begin(); i!=files.end(); ++i)
+ for(const string &f: FS::list_files(base))
{
bool match = false;
for(list<string>::const_iterator j = patterns.begin(); (j!=patterns.end() && !match); ++j)
- match = Regex(*j).match(*i);
+ match = Regex(*j).match(f);
for(list<string>::const_iterator j = excludes.begin(); (j!=excludes.end() && match); ++j)
- match = !Regex(*j).match(*i);
+ match = !Regex(*j).match(f);
if(match)
- compiler.process_file(base / *i, write_st);
+ compiler.process_file(base/f, write_st);
}
}