From 2c3c05aeb10f6f47cb4509dd9d2e0fab028533f9 Mon Sep 17 00:00:00 2001 From: TheBits Date: Sun, 12 Dec 2010 17:01:06 +0300 Subject: [PATCH] uniq function optimization --- web/utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/web/utils.py b/web/utils.py index 29a22d16..a56d55bf 100755 --- a/web/utils.py +++ b/web/utils.py @@ -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): """