]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
refactor: Remove empty if clause
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 9 Nov 2022 20:02:19 +0000 (21:02 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 10 Nov 2022 12:20:26 +0000 (13:20 +0100)
This is to please CodeQL's "Futile condition" check.

src/ccache.cpp

index 20ce2e2a72f8a2ef7e32a60c441911deb9650b3c..c063a58fe0c6c1d76746340ef21e7984f50e7c41 100644 (file)
@@ -166,10 +166,11 @@ prepare_debug_path(const std::string& debug_dir,
   auto prefix = debug_dir.empty()
                   ? output_obj
                   : debug_dir + util::to_absolute_path_no_drive(output_obj);
-  if (!Util::create_dir(Util::dir_name(prefix))) {
-    // Ignore since we can't handle an error in another way in this context. The
-    // caller takes care of logging when trying to open the path for writing.
-  }
+
+  // Ignore any error from create_dir since we can't handle an error in another
+  // way in this context. The caller takes care of logging when trying to open
+  // the path for writing.
+  Util::create_dir(Util::dir_name(prefix));
 
   char timestamp[100];
   const auto tm = Util::localtime(time_of_invocation);