Replace dict.has_key(x) with x in dict for performance gain

svn: r10874
This commit is contained in:
Gerald Britton
2008-07-17 18:10:32 +00:00
parent a6a264d1ce
commit 882199f1c2
80 changed files with 188 additions and 188 deletions

View File

@ -160,7 +160,7 @@ class PluginDialog(ManagedWindow.ManagedWindow):
store, node = self.selection.get_selected()
if node:
path = store.get_path(node)
if not node or not self.imap.has_key(path):
if not node or path not in self.imap:
return
data = self.imap[path]
@ -200,7 +200,7 @@ class PluginDialog(ManagedWindow.ManagedWindow):
category = _UNSUPPORTED
else:
category = categories[plugin[3]]
if item_hash.has_key(category):
if category in item_hash:
item_hash[category].append(plugin)
else:
item_hash[category] = [plugin]
@ -212,7 +212,7 @@ class PluginDialog(ManagedWindow.ManagedWindow):
key_list.reverse()
prev = None
if item_hash.has_key(_UNSUPPORTED):
if _UNSUPPORTED in item_hash:
key = _UNSUPPORTED
data = item_hash[key]
node = self.store.insert_after(None, prev)