summary refs log tree commit diff
path: root/nix/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-01 17:30:51 +0200
committerLudovic Courtès <ludo@gnu.org>2015-05-11 17:15:23 +0200
commitc51374c128cbe1f06acd95ba2d627a118a95aabf (patch)
treeb3f2d55c0bb5b9c5291597b1aece8b88ed1f0e1f /nix/libutil
parent666c9b7108e460f0d3450015a3379bfeb3e3a497 (diff)
downloadguix-c51374c128cbe1f06acd95ba2d627a118a95aabf.tar.gz
Eliminate redundant copy
Diffstat (limited to 'nix/libutil')
-rw-r--r--nix/libutil/util.cc2
-rw-r--r--nix/libutil/util.hh2
2 files changed, 3 insertions, 1 deletions
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc
index 3f9c6974c2..06c8441aed 100644
--- a/nix/libutil/util.cc
+++ b/nix/libutil/util.cc
@@ -216,7 +216,7 @@ DirEntries readDirectory(const Path & path)
         checkInterrupt();
         string name = dirent->d_name;
         if (name == "." || name == "..") continue;
-        entries.emplace_back(DirEntry({ name, dirent->d_ino, dirent->d_type }));
+        entries.emplace_back(name, dirent->d_ino, dirent->d_type);
     }
     if (errno) throw SysError(format("reading directory `%1%'") % path);
 
diff --git a/nix/libutil/util.hh b/nix/libutil/util.hh
index 462b98e0fe..cf513c008e 100644
--- a/nix/libutil/util.hh
+++ b/nix/libutil/util.hh
@@ -69,6 +69,8 @@ struct DirEntry
     string name;
     ino_t ino;
     unsigned char type; // one of DT_*
+    DirEntry(const string & name, ino_t ino, unsigned char type)
+        : name(name), ino(ino), type(type) { }
 };
 
 typedef vector<DirEntry> DirEntries;