]> git.tdb.fi Git - builder.git/blobdiff - source/task.cpp
Replace basic for loops with range-based loops or algorithms
[builder.git] / source / task.cpp
index 75b725ede8657cc760efaa07d0bb92456b51975e..d969a7afa495f4c7076b5a8583b94679b0f25650 100644 (file)
@@ -22,16 +22,16 @@ void Task::set_unlink(bool u)
 
 void Task::prepare()
 {
-       for(list<FS::Path>::const_iterator i=files.begin(); i!=files.end(); ++i)
+       for(const FS::Path &f: files)
        {
-               if(FS::exists(*i))
+               if(FS::exists(f))
                {
                        // If the file exists, the directory it's in must exist too
-                       FS::unlink(*i);
+                       FS::unlink(f);
                }
                else
                {
-                       FS::Path dir = FS::dirname(*i);
+                       FS::Path dir = FS::dirname(f);
                        if(!FS::exists(dir))
                                FS::mkpath(dir, 0755);
                }