mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 23:10:17 +00:00
Optimized set intersection for tag checking.
This commit is contained in:
+3
-6
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user