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 17:33:43 -06:00
committed by GitHub
parent 612da3ec47
commit 2a383e9ddd
29 changed files with 54 additions and 77 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;
}
}