[Zope-Checkins] CVS: Products/ZCatalog - Catalog.py:1.111.2.7

Sidnei da Silva sidnei at awkly.org
Fri Mar 11 11:24:51 EST 2005


Update of /cvs-repository/Products/ZCatalog
In directory cvs.zope.org:/tmp/cvs-serv21172/lib/python/Products/ZCatalog

Modified Files:
      Tag: Zope-2_7-branch
	Catalog.py 
Log Message:

      - Use 'del' instead of 'list.remove()' in
        Catalog.delColumn(). There can be only one column with the
        same name, and it could potentially break catalog metadata as
        remove() may remove more than one element from the list if
        they have the same value. Also, we already have the list index
        we are interested in deleting so it doesn't make sense to look
        up the value and call 'list.remove()' on it.


=== Products/ZCatalog/Catalog.py 1.111.2.6 => 1.111.2.7 ===
--- Products/ZCatalog/Catalog.py:1.111.2.6	Tue May 18 10:48:48 2004
+++ Products/ZCatalog/Catalog.py	Fri Mar 11 11:24:51 2005
@@ -226,7 +226,7 @@
                                    'nonexistent column %s.' % str(name)))
             return
 
-        names.remove(name)
+        del names[_index]
 
         # rebuild the schema
         i=0; schema = {}
@@ -243,7 +243,7 @@
         # remove the column value from each record
         for key in self.data.keys():
             rec = list(self.data[key])
-            rec.remove(rec[_index])
+            del rec[_index]
             self.data[key] = tuple(rec)
 
     def addIndex(self, name, index_type):



More information about the Zope-Checkins mailing list