Skip to content

Commit

Permalink
Avoid intermediate list creation in catalog.delColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Apr 7, 2012
1 parent b7de72e commit c7c607b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Products/ZCatalog/Catalog.py
Expand Up @@ -213,10 +213,11 @@ def delColumn(self, name):
self.updateBrains()

# remove the column value from each record
for key, value in self.data.items():
_next_index = _index + 1
for key, value in self.data.iteritems():
rec = list(value)
del rec[_index]
self.data[key] = tuple(rec)
self.data[key] = value[:_index] + value[_next_index:]

def addIndex(self, name, index_type):
"""Create a new index, given a name and a index_type.
Expand Down

0 comments on commit c7c607b

Please sign in to comment.