##// END OF EJS Templates
util: simplify unique
Matt Mackall -
r5881:4bb64294 default
parent child Browse files
Show More
@@ -236,13 +236,7 b' def binary(s):'
236
236
237 def unique(g):
237 def unique(g):
238 """return the uniq elements of iterable g"""
238 """return the uniq elements of iterable g"""
239 seen = {}
239 return dict.fromkeys(g).keys()
240 l = []
241 for f in g:
242 if f not in seen:
243 seen[f] = 1
244 l.append(f)
245 return l
246
240
247 class Abort(Exception):
241 class Abort(Exception):
248 """Raised if a command needs to print an error and exit."""
242 """Raised if a command needs to print an error and exit."""
General Comments 0
You need to be logged in to leave comments. Login now