From 45526cd6a2ccded96a3b3c9df8cf4095f6adb440 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 16 Feb 2020 20:44:42 +0100 Subject: [PATCH] Simplify string creation from string_view --- src/ccache.cpp | 2 +- src/stats.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ccache.cpp b/src/ccache.cpp index da294b3b7..bd2964f6c 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -1386,7 +1386,7 @@ to_cache(Context& ctx, // be done almost anywhere, but we might as well do it near the end as we // save the stat call if we exit early. { - std::string first_level_dir = std::string(Util::dir_name(ctx.stats_file)); + std::string first_level_dir(Util::dir_name(ctx.stats_file)); if (!create_cachedir_tag(first_level_dir) != 0) { cc_log("Failed to create %s/CACHEDIR.TAG (%s)", first_level_dir.c_str(), diff --git a/src/stats.cpp b/src/stats.cpp index c88d7713e..a789a1697 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -393,7 +393,7 @@ stats_flush_to_file(const Config& config, stats_write(sfile, counters); lockfile_release(sfile.c_str()); - std::string subdir = std::string(Util::dir_name(sfile)); + std::string subdir(Util::dir_name(sfile)); bool need_cleanup = false; if (config.max_files() != 0 -- 2.47.2