From b633f26a7a9e1786d06f3ce9cf7031395a637068 Mon Sep 17 00:00:00 2001 From: Ali Alamiri Date: Mon, 25 May 2020 11:59:11 +0100 Subject: [PATCH] Save basic_string copy Co-authored-by: tt4g <45120617+tt4g@users.noreply.github.com> --- include/spdlog/details/os-inl.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index 0fcfa10a..7b2198f8 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -605,11 +605,14 @@ SPDLOG_INLINE std::vector get_directory_files(const std::string &di while ((ent = readdir(dir)) != nullptr) { - const std::string file_name = ent->d_name; - const std::string full_file_name = directory + "/" + file_name; + const std::string file_name::value_type* = ent->d_name; if (file_name[0] == '.') + { continue; + } + + const std::string full_file_name = directory + "/" + file_name; if (::stat(full_file_name.c_str(), &st) == -1) continue;