Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
avoid intermediate variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Dec 3, 2012
1 parent f16f86b commit 99f5f60
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Products/ZCTextIndex/ZCTextIndex.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def index_object(self, documentId, obj, threshold=None):
# needed for backward compatibility
fields = getattr(self, '_indexed_attrs', [self._fieldname])

res = 0
all_texts = []
for attr in fields:
text = getattr(obj, attr, None)
Expand All @@ -195,7 +194,7 @@ def index_object(self, documentId, obj, threshold=None):
all_texts = [t for t in all_texts if isinstance(t, basestring)]
if all_texts or self.index.length():
return self.index.index_doc(documentId, all_texts)
return res
return 0

def unindex_object(self, docid):
if self.index.has_doc(docid):
Expand Down

0 comments on commit 99f5f60

Please sign in to comment.