builddependencies: remove a use of defaultdict
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 25 Jul 2018 14:21:49 -0700
changeset 3903 038cdaca7145
parent 3902 9c4847b93d3c
child 3904 d2d03df3956f
builddependencies: remove a use of defaultdict I don't see much reason to make "rdependencies" be a defaultdict when "dependencies" is not. It's easy to initialize each entry ourselves.
hgext3rd/evolve/utility.py
--- a/hgext3rd/evolve/utility.py	Tue Jul 31 09:03:35 2018 +0200
+++ b/hgext3rd/evolve/utility.py	Wed Jul 25 14:21:49 2018 -0700
@@ -5,8 +5,6 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-import collections
-
 from mercurial import (
     obsutil,
 )
@@ -95,7 +93,7 @@
     # Means that: 6 has no dependency, 3 depends on 6 to be solved
     dependencies = {}
     # rdependencies is the inverted dict of dependencies
-    rdependencies = collections.defaultdict(set)
+    rdependencies = {r: set() for r in revs}
 
     for r in revs:
         dependencies[r] = set()