]> git.tdb.fi Git - libs/datafile.git/blobdiff - tool/compiler.cpp
Use C++11 features to manipulate containers
[libs/datafile.git] / tool / compiler.cpp
index 49dd19031cc0408fc958e84afd3fcfa4063bc403..8360ee6ce35931b52f5867bfb75ffdddeb713df1 100644 (file)
@@ -166,16 +166,15 @@ ForEach::ForEach(Compiler &c, const FS::Path &b, const list<string> &p):
 
 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);
        }
 }