changeset 8478:d728f126c1b7

ui: use set instead of dict
author Martin Geisler <mg@lazybytes.net>
date Sun, 17 May 2009 16:20:27 +0200
parents a0104303f400
children 3e16c0fc2241
files mercurial/ui.py
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Sun May 17 16:15:37 2009 +0200
+++ b/mercurial/ui.py	Sun May 17 16:20:27 2009 +0200
@@ -20,8 +20,8 @@
         self._ocfg = config.config() # overlay
         self._tcfg = config.config() # trusted
         self._ucfg = config.config() # untrusted
-        self._trustusers = {}
-        self._trustgroups = {}
+        self._trustusers = set()
+        self._trustgroups = set()
 
         if src:
             self._tcfg = src._tcfg.copy()
@@ -104,10 +104,8 @@
         self._traceback = self.configbool('ui', 'traceback', False)
 
         # update trust information
-        for user in self.configlist('trusted', 'users'):
-            self._trustusers[user] = 1
-        for group in self.configlist('trusted', 'groups'):
-            self._trustgroups[group] = 1
+        self._trustusers.update(self.configlist('trusted', 'users'))
+        self._trustgroups.update(self.configlist('trusted', 'groups'))
 
     def setconfig(self, section, name, value):
         for cfg in (self._ocfg, self._tcfg, self._ucfg):