The libc++ upgrade means we can use contains() in the linker now.
Change-Id: I30f764ddfd101dde1b7bbcefbf78182a19b3db7c
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 8b467a3..e13d37d 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3595,7 +3595,7 @@
// 2. Initialize other namespaces
for (auto& ns_config : namespace_configs) {
- if (namespaces.find(ns_config->name()) != namespaces.end()) {
+ if (namespaces.contains(ns_config->name())) {
continue;
}
diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp
index ad40c50..70430b8 100644
--- a/linker/linker_config.cpp
+++ b/linker/linker_config.cpp
@@ -304,7 +304,7 @@
}
if (result == ConfigParser::kPropertyAssign) {
- if (properties->find(name) != properties->end()) {
+ if (properties->contains(name)) {
DL_WARN("%s:%zd: warning: redefining property \"%s\" (overriding previous value)",
ld_config_file_path,
cp.lineno(),
@@ -313,7 +313,7 @@
(*properties)[name] = PropertyValue(std::move(value), cp.lineno());
} else if (result == ConfigParser::kPropertyAppend) {
- if (properties->find(name) == properties->end()) {
+ if (!properties->contains(name)) {
DL_WARN("%s:%zd: warning: appending to undefined property \"%s\" (treating as assignment)",
ld_config_file_path,
cp.lineno(),
@@ -526,7 +526,7 @@
properties.get_strings(property_name_prefix + ".links", &lineno);
for (const auto& linked_ns_name : linked_namespaces) {
- if (namespace_configs.find(linked_ns_name) == namespace_configs.end()) {
+ if (!namespace_configs.contains(linked_ns_name)) {
*error_msg = create_error_msg(ld_config_file_path,
lineno,
std::string("undefined namespace: ") + linked_ns_name);
diff --git a/linker/linker_namespaces.cpp b/linker/linker_namespaces.cpp
index 5182129..eb9dae9 100644
--- a/linker/linker_namespaces.cpp
+++ b/linker/linker_namespaces.cpp
@@ -100,7 +100,7 @@
// be searched.
if (allow_secondary) {
const android_namespace_list_t& secondary_namespaces = si->get_secondary_namespaces();
- if (secondary_namespaces.find(this) != secondary_namespaces.end()) {
+ if (secondary_namespaces.contains(this)) {
return true;
}
}
diff --git a/linker/linker_soinfo.cpp b/linker/linker_soinfo.cpp
index 802c06a..d915503 100644
--- a/linker/linker_soinfo.cpp
+++ b/linker/linker_soinfo.cpp
@@ -887,7 +887,7 @@
handle_ = handle_ | 1;
} while (handle_ == reinterpret_cast<uintptr_t>(RTLD_DEFAULT) ||
handle_ == reinterpret_cast<uintptr_t>(RTLD_NEXT) ||
- g_soinfo_handles_map.find(handle_) != g_soinfo_handles_map.end());
+ g_soinfo_handles_map.contains(handle_));
g_soinfo_handles_map[handle_] = this;
}