diff hgext/bugzilla.py @ 8152:08e1baf924ca

replace set-like dictionaries with real sets Many of the dictionaries created by dict.fromkeys were emulating sets. These can now be replaced with real sets.
author Martin Geisler <mg@lazybytes.net>
date Wed, 22 Apr 2009 00:57:28 +0200
parents 912bfef12ba6
children 1750510251d0
line wrap: on
line diff
--- a/hgext/bugzilla.py	Wed Apr 22 00:56:06 2009 +0200
+++ b/hgext/bugzilla.py	Wed Apr 22 00:57:28 2009 +0200
@@ -177,12 +177,12 @@
         self.run('''select bug_id from longdescs where
                     bug_id in %s and thetext like "%%%s%%"''' %
                  (buglist(ids), short(node)))
-        unknown = dict.fromkeys(ids)
+        unknown = set(ids)
         for (id,) in self.cursor.fetchall():
             self.ui.status(_('bug %d already knows about changeset %s\n') %
                            (id, short(node)))
-            unknown.pop(id, None)
-        return util.sort(unknown.keys())
+            unknown.discard(id)
+        return util.sort(unknown)
 
     def notify(self, ids, committer):
         '''tell bugzilla to send mail.'''