Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: ppapi/native_client/src/trusted/plugin/plugin.cc

Issue 10959008: Avoid using NULL comparison to check if element is in the map. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/plugin.cc
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 1f8b0cbc934402cd79e678fd847fa33ed623be98..a14cc4ff84c7e5b5be3455f99cdf3df2ac22a3d6 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -441,17 +441,17 @@ void Plugin::AddPropertyGet(const nacl::string& prop_name,
bool Plugin::HasProperty(const nacl::string& prop_name) {
PLUGIN_PRINTF(("Plugin::HasProperty (prop_name=%s)\n",
prop_name.c_str()));
- return property_getters_[prop_name] != NULL;
+ return property_getters_.find(prop_name) != property_getters_.end();
}
bool Plugin::GetProperty(const nacl::string& prop_name,
NaClSrpcArg* prop_value) {
PLUGIN_PRINTF(("Plugin::GetProperty (prop_name=%s)\n", prop_name.c_str()));
- PropertyGetter getter = property_getters_[prop_name];
- if (NULL == getter) {
+ if (property_getters_.find(prop_name) == property_getters_.end()) {
return false;
}
+ PropertyGetter getter = property_getters_[prop_name];
(this->*getter)(prop_value);
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698