summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-30 22:19:56 +0100
committerMax Kellermann <max@duempel.org>2014-01-30 22:19:56 +0100
commita631200cca3fb19bca96340a92fb882acb2d5631 (patch)
tree4e683f71977b12419855612e78b1d7cb64062f13 /src
parent6207a3f99976fe03e1e325833344e8859ab1fd92 (diff)
update/Walk: declare std::string at assignment
Reduce overhead.
Diffstat (limited to 'src')
-rw-r--r--src/db/update/Walk.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx
index 5a799d8f7..1ca589456 100644
--- a/src/db/update/Walk.cxx
+++ b/src/db/update/Walk.cxx
@@ -341,15 +341,12 @@ UpdateWalk::UpdateDirectory(Directory &directory, const struct stat *st)
PurgeDeletedFromDirectory(directory);
while (reader.ReadEntry()) {
- std::string utf8;
- struct stat st2;
-
const auto entry = reader.GetEntry();
if (skip_path(entry) || exclude_list.Check(entry))
continue;
- utf8 = entry.ToUTF8();
+ const std::string utf8 = entry.ToUTF8();
if (utf8.empty())
continue;
@@ -358,6 +355,7 @@ UpdateWalk::UpdateDirectory(Directory &directory, const struct stat *st)
continue;
}
+ struct stat st2;
if (stat_directory_child(directory, utf8.c_str(), &st2) == 0)
UpdateDirectoryChild(directory, utf8.c_str(), &st2);
else