Skip to content

Commit

Permalink
uniq function optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBits committed Dec 12, 2010
1 parent dc961c9 commit 2c3c05a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions web/utils.py
Expand Up @@ -541,13 +541,7 @@ def uniq(seq):
>>> uniq([1,2,3,1,4,5,6])
[1, 2, 3, 4, 5, 6]
"""
seen = set()
result = []
for item in seq:
if item in seen: continue
seen.add(item)
result.append(item)
return result
return list(set(seq))

def iterview(x):
"""
Expand Down

0 comments on commit 2c3c05a

Please sign in to comment.