Commit b0c3abbe authored by Vincent Pelletier's avatar Vincent Pelletier

Revert commits 889 & 890, as they introduce a bug (all list items are the same instance).


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@898 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 8e5b32aa
......@@ -60,7 +60,10 @@ class PartitionTable(object):
self.np = num_partitions
self.nr = num_replicas
self.num_filled_rows = 0
self.partition_list = [[]] * num_partitions
# Note: don't use [[]] * num_partition construct, as it duplicates
# instance *references*, so the outer list contains really just one
# inner list instance.
self.partition_list = [[] for x in xrange(num_partitions)]
self.count_dict = {}
def getID(self):
......@@ -75,7 +78,10 @@ class PartitionTable(object):
def clear(self):
"""Forget an existing partition table."""
self.num_filled_rows = 0
self.partition_list = [[]] * self.np
# Note: don't use [[]] * self.np construct, as it duplicates
# instance *references*, so the outer list contains really just one
# inner list instance.
self.partition_list = [[] for x in xrange(self.np)]
self.count_dict.clear()
def hasOffset(self, offset):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment