From: Joel Rosdahl Date: Tue, 3 Feb 2026 19:26:56 +0000 (+0100) Subject: refactor: Use C++20 .contains(...) instead of .find() != .end() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f469eab7b3c203c4eed40a4e300bfb72ef855f40;p=thirdparty%2Fccache.git refactor: Use C++20 .contains(...) instead of .find() != .end() --- diff --git a/src/ccache/argprocessing.cpp b/src/ccache/argprocessing.cpp index 425875bb..40461349 100644 --- a/src/ccache/argprocessing.cpp +++ b/src/ccache/argprocessing.cpp @@ -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); } diff --git a/src/ccache/ccache.cpp b/src/ccache/ccache.cpp index 391afa94..a33ad7fe 100644 --- a/src/ccache/ccache.cpp +++ b/src/ccache/ccache.cpp @@ -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 {}; }