]> git.tdb.fi Git - builder.git/blobdiff - source/task.cpp
Use default member initializers and constructor delegation
[builder.git] / source / task.cpp
index 75b725ede8657cc760efaa07d0bb92456b51975e..e72a7415de285767ee93369051fb384113b8d2a1 100644 (file)
@@ -6,10 +6,6 @@
 using namespace std;
 using namespace Msp;
 
-Task::Task():
-       unlink(false)
-{ }
-
 void Task::add_file(const FS::Path &f)
 {
        files.push_back(f);
@@ -22,16 +18,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);
                }