[Erp5-report] r35291 nicolas.dumazet - /erp5/trunk/products/ERP5/mixin/cached_convertable.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu May 13 04:12:23 CEST 2010
Author: nicolas.dumazet
Date: Thu May 13 04:12:23 2010
New Revision: 35291
URL: http://svn.erp5.org?rev=35291&view=rev
Log:
Simplify Pdata walk
Modified:
erp5/trunk/products/ERP5/mixin/cached_convertable.py
Modified: erp5/trunk/products/ERP5/mixin/cached_convertable.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/mixin/cached_convertable.py?rev=35291&r1=35290&r2=35291&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/mixin/cached_convertable.py [utf8] (original)
+++ erp5/trunk/products/ERP5/mixin/cached_convertable.py [utf8] Thu May 13 04:12:23 2010
@@ -44,18 +44,15 @@
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:
More information about the Erp5-report
mailing list