[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
82/118: Eliminate redundant copy
From: |
Ludovic Courtès |
Subject: |
82/118: Eliminate redundant copy |
Date: |
Tue, 19 May 2015 14:45:50 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit c51374c128cbe1f06acd95ba2d627a118a95aabf
Author: Eelco Dolstra <address@hidden>
Date: Fri Aug 1 17:30:51 2014 +0200
Eliminate redundant copy
---
nix/libutil/util.cc | 2 +-
nix/libutil/util.hh | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc
index 3f9c697..06c8441 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 462b98e..cf513c0 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;
- 88/118: Move some options out of globals, (continued)
- 88/118: Move some options out of globals, Ludovic Courtès, 2015/05/19
- 83/118: Call commonChildInit() before doing chroot init, Ludovic Courtès, 2015/05/19
- 84/118: Remove ugly hack for detecting build environment setup errors, Ludovic Courtès, 2015/05/19
- 85/118: Get rid of "killing <pid>" message for unused build hooks, Ludovic Courtès, 2015/05/19
- 93/118: Reduce verbosity, Ludovic Courtès, 2015/05/19
- 92/118: Propagate remote timeouts properly, Ludovic Courtès, 2015/05/19
- 87/118: Refactor, Ludovic Courtès, 2015/05/19
- 79/118: Allow regular files as GC roots, Ludovic Courtès, 2015/05/19
- 89/118: Doh, Ludovic Courtès, 2015/05/19
- 78/118: Remove some dead code, Ludovic Courtès, 2015/05/19
- 82/118: Eliminate redundant copy,
Ludovic Courtès <=
- 95/118: Make hook shutdown more reliable, Ludovic Courtès, 2015/05/19
- 81/118: findRoots(): Prevent a call to lstat(), Ludovic Courtès, 2015/05/19
- 101/118: On Linux, disable address space randomization, Ludovic Courtès, 2015/05/19
- 91/118: Use regular file GC roots if possible, Ludovic Courtès, 2015/05/19
- 102/118: Remove bogus comment, Ludovic Courtès, 2015/05/19
- 80/118: Make readDirectory() return inode / file type, Ludovic Courtès, 2015/05/19
- 94/118: Doh, Ludovic Courtès, 2015/05/19
- 96/118: fix disappearing bash arguments, Ludovic Courtès, 2015/05/19
- 104/118: createDirs(): Handle ‘path’ being a symlink, Ludovic Courtès, 2015/05/19
- 103/118: nix-daemon: Close unnecessary fd, Ludovic Courtès, 2015/05/19