[Checkins] SVN: Products.ZCTextIndex/trunk/src/Products/ZCTextIndex/ZCTextIndex.py avoid intermediate variable

Hano Schlichting cvs-admin at zope.org
Mon Dec 3 09:59:05 UTC 2012


Log message for revision 128483:
  avoid intermediate variable
  

Changed:
  U   Products.ZCTextIndex/trunk/src/Products/ZCTextIndex/ZCTextIndex.py

-=-
Modified: Products.ZCTextIndex/trunk/src/Products/ZCTextIndex/ZCTextIndex.py
===================================================================
--- Products.ZCTextIndex/trunk/src/Products/ZCTextIndex/ZCTextIndex.py	2012-12-03 09:55:55 UTC (rev 128482)
+++ Products.ZCTextIndex/trunk/src/Products/ZCTextIndex/ZCTextIndex.py	2012-12-03 09:59:04 UTC (rev 128483)
@@ -175,7 +175,6 @@
         # needed for backward compatibility
         fields = getattr(self, '_indexed_attrs', [self._fieldname])
 
-        res = 0
         all_texts = []
         for attr in fields:
             text = getattr(obj, attr, None)
@@ -195,7 +194,7 @@
         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):



More information about the checkins mailing list