Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shlib: use set instead of list

Changeset 7740ffc8c32f

Parent e179c99e0585

by Simon Heimberg

Changes to one file · Browse files at 7740ffc8c32f Showing diff from parent e179c99e0585 Diff from another changeset...

Change 1 of 1 Show Entire File thgutil/​shlib.py Stacked
 
158
159
160
161
 
162
163
164
165
166
167
 
168
169
170
 
171
172
173
 
158
159
160
 
161
162
163
164
165
 
 
166
167
 
 
168
169
170
171
@@ -158,16 +158,14 @@
  import pywintypes   except ImportError:   return - dirs = [] + dirs = set()   for path in paths:   abspath = os.path.abspath(path)   if not os.path.isdir(abspath):   abspath = os.path.dirname(abspath) - if abspath not in dirs: - dirs.append(abspath) + dirs.add(abspath)   # send notifications to deepest directories first - dirs.sort(lambda x, y: len(y) - len(x)) - for dir in dirs: + for dir in sorted(dirs, key=len, reverse=True):   try:   pidl, ignore = shell.SHILCreateFromPath(dir, 0)   except pywintypes.com_error: