]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
refactor: Use C++20 .contains(...) instead of .find() != .end()
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 3 Feb 2026 19:26:56 +0000 (20:26 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 3 Feb 2026 19:26:56 +0000 (20:26 +0100)
src/ccache/argprocessing.cpp
src/ccache/ccache.cpp

index 425875bb675014346850dc2d339450250ca74f99..40461349c44ba7212d7e6ddb0a7a5baeb8b34743 100644 (file)
@@ -1739,11 +1739,11 @@ process_args(Context& ctx)
   }
 
   if (state.xarch_args.size() > 1) {
-    if (state.xarch_args.find("host") != state.xarch_args.end()) {
+    if (state.xarch_args.contains("host")) {
       LOG_RAW("-Xarch_host in combination with other -Xarch_* is too hard");
       return tl::unexpected(Statistic::unsupported_compiler_option);
     }
-    if (state.xarch_args.find("device") != state.xarch_args.end()) {
+    if (state.xarch_args.contains("device")) {
       LOG_RAW("-Xarch_device in combination with other -Xarch_* is too hard");
       return tl::unexpected(Statistic::unsupported_compiler_option);
     }
index 391afa94b91da49d59c39603bc1938f1f79e92ab..a33ad7fea626344d544ca752dd23b5f29a0c1c2a 100644 (file)
@@ -383,7 +383,7 @@ remember_include_file(Context& ctx,
     return {};
   }
 
-  if (ctx.included_files.find(path_str) != ctx.included_files.end()) {
+  if (ctx.included_files.contains(path_str)) {
     // Already known include file.
     return {};
   }