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

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

Issue 10917259: Avoid using NULL comparison to check if element is in the map. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/ppapi/
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: native_client/src/trusted/plugin/plugin.cc
===================================================================
--- native_client/src/trusted/plugin/plugin.cc (revision 147940)
+++ native_client/src/trusted/plugin/plugin.cc (working copy)
@@ -493,17 +493,18 @@
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