Optimized set intersection for tag checking.

This commit is contained in:
Kenneth Reitz
2010-11-05 09:46:14 -04:00
parent f364bb576e
commit 2bb0525990
+3 -6
View File
@@ -76,12 +76,9 @@ class Row(object):
if tag == None:
return False
elif isinstance(tag, basestring):
return tag in self.tags
else:
for t in tag:
if t in self.tags:
return True
return False
return (tag in self.tags)
else:
return True if len(set(tag) & set(self.tags)) else False
class Dataset(object):