refactor: use C++20's contains() method (35-x-y) (#45768)

refactor: use C++20's contains() method (#45742)

* chore: use std::map<>::contains() instead of count() or find()

* chore: use std::map<>::contains() instead of base::Contains()
This commit is contained in:
Charles Kerr 2025-02-21 20:45:54 -06:00 committed by GitHub
parent 2da02ec9bc
commit 4c81971213
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 52 additions and 75 deletions

View file

@ -6,7 +6,6 @@
#include <vector>
#include "base/containers/contains.h"
#include "content/public/common/webplugininfo.h"
#include "electron/buildflags/buildflags.h"
#include "url/gurl.h"
@ -53,8 +52,7 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
if (MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension)) {
for (const auto& supported_mime_type : handler->mime_type_set()) {
DCHECK(!base::Contains(mime_type_to_extension_id_map,
supported_mime_type));
DCHECK(!mime_type_to_extension_id_map.contains(supported_mime_type));
mime_type_to_extension_id_map[supported_mime_type] = extension_id;
}
}