Commit 997147fc authored by Adrien Béraud's avatar Adrien Béraud Committed by Sébastien Blin

fileutils: cleanup

Change-Id: I3229003d89a4c4855fb9429dd4fe9bff02ef7985
Reviewed-by: Sébastien Blin's avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent c6bee418
......@@ -115,11 +115,11 @@ CallFactory::getAllCalls<Call>() const
for (const auto& itemmap : callMaps_) {
const auto& map = itemmap.second;
for (const auto item : map)
v.reserve(v.size() + map.size());
for (const auto& item : map)
v.push_back(item.second);
}
v.shrink_to_fit();
return v;
}
......
......@@ -412,10 +412,10 @@ readDirectory(const std::string& dir)
#else
while ((entry = readdir(dp)) != nullptr) {
#endif
const std::string fname {entry->d_name};
std::string fname {entry->d_name};
if (fname == "." || fname == "..")
continue;
files.push_back(std::move(fname));
files.emplace_back(std::move(fname));
}
closedir(dp);
return files;
......@@ -691,7 +691,7 @@ recursive_mkdir(const std::string& path, mode_t mode)
if (mkdir(path.data()) != 0) {
#endif
if (errno == ENOENT) {
recursive_mkdir(path.substr(0, path.find_last_of(DIR_SEPARATOR_STR)), mode);
recursive_mkdir(path.substr(0, path.find_last_of(DIR_SEPARATOR_CH)), mode);
#ifndef _WIN32
if (mkdir(path.data(), mode) != 0) {
#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