In addition to the review-comment: I propose putting save_eval into a module by it's own ...
16 years, 5 months ago
(2009-12-15 16:34:53 UTC)
#3
In addition to the review-comment:
I propose putting save_eval into a module by it's own which can easily be held
consistent between client and server. Seeing non-trivial code duplicated within
a project always makes me shiver.
http://codereview.appspot.com/179056/diff/1/2
File tryton/common/common.py (right):
http://codereview.appspot.com/179056/diff/1/2#newcode1188
tryton/common/common.py:1188: if hashlib:
Since you are implementing a cache to gain speed, I suggest removing this
if-statement:
# change import section above like this:
try:
import hashlib
MD5 = hashlib.md5
except ImportError:
import md5
MD5 = md5.new
#change this if-statement into
key = MD5(source).digest()
Additionally, I see no need for an hexdigest here, so we can use a normals
digest, which cheaper.
Issue 179056: Add cache to safe_eval
(Closed)
Created 16 years, 5 months ago by ced1
Modified 16 years, 5 months ago
Reviewers: bch, h.goebel
Base URL:
Comments: 1