]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
chore: Remove obsolete Util::is_dir_separator
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 21 Nov 2023 20:02:43 +0000 (21:02 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 23 Nov 2023 20:27:03 +0000 (21:27 +0100)
src/Util.hpp
unittest/test_Util.cpp

index 6159390f0acd51559f25f06780c34cd785cd9778..48e543cec97a1b7722cbad600f12df7bbde869df 100644 (file)
@@ -63,18 +63,6 @@ std::string get_relative_path(std::string_view dir, std::string_view path);
 // point.
 std::optional<size_t> is_absolute_path_with_prefix(std::string_view path);
 
-// Return whether `ch` is a directory separator, i.e. '/' on POSIX systems and
-// '/' or '\\' on Windows systems.
-inline bool
-is_dir_separator(char ch)
-{
-  return ch == '/'
-#ifdef _WIN32
-         || ch == '\\'
-#endif
-    ;
-}
-
 // Construct a normalized native path.
 //
 // Example:
index d258e2e5ebb7fac02b01c48262b672fc8f1b0b50..ba5949536b8d91d718ea726cb3370dc04c8e7873 100644 (file)
@@ -169,17 +169,6 @@ TEST_CASE("Util::is_absolute_path_with_prefix")
 #endif
 }
 
-TEST_CASE("Util::is_dir_separator")
-{
-  CHECK(!Util::is_dir_separator('x'));
-  CHECK(Util::is_dir_separator('/'));
-#ifdef _WIN32
-  CHECK(Util::is_dir_separator('\\'));
-#else
-  CHECK(!Util::is_dir_separator('\\'));
-#endif
-}
-
 TEST_CASE("Util::make_relative_path")
 {
   using Util::make_relative_path;