[Checkins] SVN: zope.index/branches/nadako-sorting/src/zope/index/keyword/index.py Add useful comment on sort function use.

Dan Korostelev nadako at gmail.com
Sun Dec 28 01:43:06 EST 2008


Log message for revision 94404:
  Add useful comment on sort function use.

Changed:
  U   zope.index/branches/nadako-sorting/src/zope/index/keyword/index.py

-=-
Modified: zope.index/branches/nadako-sorting/src/zope/index/keyword/index.py
===================================================================
--- zope.index/branches/nadako-sorting/src/zope/index/keyword/index.py	2008-12-28 06:41:46 UTC (rev 94403)
+++ zope.index/branches/nadako-sorting/src/zope/index/keyword/index.py	2008-12-28 06:43:06 UTC (rev 94404)
@@ -142,6 +142,8 @@
         if operator == 'or':
             rs = self.family.IF.multiunion(sets)
         elif operator == 'and':
+            # sort smallest to largest set so we intersect the smallest
+            # number of document identifiers possible
             sets.sort(key=len)
             rs = None
             for set in sets:



More information about the Checkins mailing list