Commit e5cb0d8e authored by Nicolas Dumazet's avatar Nicolas Dumazet

Simplify Pdata walk


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35291 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3cd40639
......@@ -44,18 +44,15 @@ def makeSortedTuple(kw):
items.sort()
return tuple(items)
def hashPdataObject(data):
def hashPdataObject(pdata_object):
"""Pdata objects are iterable, use this feature strongly
to minimize memory footprint.
"""
md5_hash = md5.new()
next = chunk = data.next
if next is None:
md5_hash.update(data.data)
next = pdata_object
while next is not None:
chunk = next
md5_hash.update(chunk)
next = data.next
md5_hash.update(next.data)
next = next.next
return md5_hash.hexdigest()
class CachedConvertableMixin:
......
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