]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Simplify string creation from string_view
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 16 Feb 2020 19:44:42 +0000 (20:44 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 16 Feb 2020 20:19:31 +0000 (21:19 +0100)
src/ccache.cpp
src/stats.cpp

index da294b3b79da5b167dfc513f21460f9276f657ea..bd2964f6c48bf49ab7a7a1bef4cf42c0f2e42444 100644 (file)
@@ -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(),
index c88d7713e1986bc0fed1fb995c3659d004c1b81c..a789a1697ce3c1773438514ec2324be9e3121ee5 100644 (file)
@@ -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