Permalink
Browse files

uniq function optimization

  • Loading branch information...
1 parent dc961c9 commit 2c3c05aeb10f6f47cb4509dd9d2e0fab028533f9 @TheBits TheBits committed Dec 12, 2010
Showing with 1 addition and 7 deletions.
  1. +1 −7 web/utils.py
View
@@ -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):
"""

0 comments on commit 2c3c05a

Please sign in to comment.