Commit 1059ac65 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Remove XXX relatoted to inaccurate size computation in the MQ class because this

is already described in the class docstring.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1160 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 48af274b
...@@ -160,7 +160,7 @@ class MQ(object): ...@@ -160,7 +160,7 @@ class MQ(object):
data = self._data[key] data = self._data[key]
if data.level >= 0: if data.level >= 0:
value = data.value value = data.value
self._size -= sizeof(value) # XXX inaccurate self._size -= sizeof(value)
self.store(key, value) self.store(key, value)
return value return value
raise KeyError(key) raise KeyError(key)
...@@ -178,7 +178,7 @@ class MQ(object): ...@@ -178,7 +178,7 @@ class MQ(object):
Evict an element to the history buffer. Evict an element to the history buffer.
""" """
data = self._data[key] data = self._data[key]
self._size -= sizeof(data.value) # XXX inaccurate self._size -= sizeof(data.value)
del self._cache_buffers[data.level][data.element] del self._cache_buffers[data.level][data.element]
element = self._history_buffer.append() element = self._history_buffer.append()
data.level = -1 data.level = -1
...@@ -215,7 +215,7 @@ class MQ(object): ...@@ -215,7 +215,7 @@ class MQ(object):
data.counter = counter data.counter = counter
element.data = data element.data = data
self._data[key] = data self._data[key] = data
self._size += sizeof(value) # XXX inaccurate self._size += sizeof(value)
del value del value
self._time += 1 self._time += 1
...@@ -249,7 +249,7 @@ class MQ(object): ...@@ -249,7 +249,7 @@ class MQ(object):
break break
data = element.data data = element.data
del self._data[data.key] del self._data[data.key]
size -= sizeof(data.value) # XXX inaccurate size -= sizeof(data.value)
del data.value del data.value
if size <= max_size: if size <= max_size:
break break
......
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