Commit a631200c authored by Max Kellermann's avatar Max Kellermann

update/Walk: declare std::string at assignment

Reduce overhead.
parent 6207a3f9
...@@ -341,15 +341,12 @@ UpdateWalk::UpdateDirectory(Directory &directory, const struct stat *st) ...@@ -341,15 +341,12 @@ UpdateWalk::UpdateDirectory(Directory &directory, const struct stat *st)
PurgeDeletedFromDirectory(directory); PurgeDeletedFromDirectory(directory);
while (reader.ReadEntry()) { while (reader.ReadEntry()) {
std::string utf8;
struct stat st2;
const auto entry = reader.GetEntry(); const auto entry = reader.GetEntry();
if (skip_path(entry) || exclude_list.Check(entry)) if (skip_path(entry) || exclude_list.Check(entry))
continue; continue;
utf8 = entry.ToUTF8(); const std::string utf8 = entry.ToUTF8();
if (utf8.empty()) if (utf8.empty())
continue; continue;
...@@ -358,6 +355,7 @@ UpdateWalk::UpdateDirectory(Directory &directory, const struct stat *st) ...@@ -358,6 +355,7 @@ UpdateWalk::UpdateDirectory(Directory &directory, const struct stat *st)
continue; continue;
} }
struct stat st2;
if (stat_directory_child(directory, utf8.c_str(), &st2) == 0) if (stat_directory_child(directory, utf8.c_str(), &st2) == 0)
UpdateDirectoryChild(directory, utf8.c_str(), &st2); UpdateDirectoryChild(directory, utf8.c_str(), &st2);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment