[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
106/376: Eliminate redundant copy
From: |
Ludovic Courtès |
Subject: |
106/376: Eliminate redundant copy |
Date: |
Wed, 28 Jan 2015 22:04:21 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit eea0401d7a8ed1292f71d697e7a59c429aa18d5d
Author: Eelco Dolstra <address@hidden>
Date: Fri Aug 1 17:30:51 2014 +0200
Eliminate redundant copy
---
src/libutil/util.cc | 2 +-
src/libutil/util.hh | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 7dc6fe7..595e724 100644
--- a/src/libutil/util.cc
+++ b/src/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/src/libutil/util.hh b/src/libutil/util.hh
index 42215eb..ade52c3 100644
--- a/src/libutil/util.hh
+++ b/src/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;
- 94/376: nix-copy-closure: Drop --bzip2, --xz, --show-progress, (continued)
- 94/376: nix-copy-closure: Drop --bzip2, --xz, --show-progress, Ludovic Courtès, 2015/01/28
- 84/376: Use pthread_cancel instead of a signal, Ludovic Courtès, 2015/01/28
- 102/376: Restore default SIGPIPE handler before invoking ‘man’, Ludovic Courtès, 2015/01/28
- 98/376: nix-profile.sh: Set $SSL_CERT_FILE, Ludovic Courtès, 2015/01/28
- 96/376: nix-daemon: Pass on the user's $SSH_AUTH_SOCK to the SSH substituter, Ludovic Courtès, 2015/01/28
- 101/376: make clean: Remove Makefile.config, Ludovic Courtès, 2015/01/28
- 105/376: findRoots(): Prevent a call to lstat(), Ludovic Courtès, 2015/01/28
- 108/376: Remove ugly hack for detecting build environment setup errors, Ludovic Courtès, 2015/01/28
- 107/376: Call commonChildInit() before doing chroot init, Ludovic Courtès, 2015/01/28
- 104/376: Make readDirectory() return inode / file type, Ludovic Courtès, 2015/01/28
- 106/376: Eliminate redundant copy,
Ludovic Courtès <=
- 110/376: Make chroot builds easier to set up, Ludovic Courtès, 2015/01/28
- 109/376: Speed up nix-shell, Ludovic Courtès, 2015/01/28
- 121/376: nix-install-package: Use extra-binary-caches, Ludovic Courtès, 2015/01/28
- 119/376: Add support for order-only dependencies, Ludovic Courtès, 2015/01/28
- 118/376: install-nix-from-closure.sh: Use https channel if possible, Ludovic Courtès, 2015/01/28
- 114/376: Refactor, Ludovic Courtès, 2015/01/28
- 117/376: Remove unnecessary call to addTempRoot(), Ludovic Courtès, 2015/01/28
- 115/376: Move some options out of globals, Ludovic Courtès, 2015/01/28
- 116/376: Doh, Ludovic Courtès, 2015/01/28
- 112/376: Add option ‘build-extra-chroot-dirs’, Ludovic Courtès, 2015/01/28