mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
fileutils: cleanup
Change-Id: I3229003d89a4c4855fb9429dd4fe9bff02ef7985 Reviewed-by: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
This commit is contained in:

committed by
Sébastien Blin

parent
c6bee418b6
commit
997147fc97
@ -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
|
||||
|
Reference in New Issue
Block a user