Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(88)

Issue 178050: Add cache to safe_eval (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 5 months ago by ced1
Modified:
16 years, 5 months ago
Reviewers:
bch, h.goebel, yangoon1
Visibility:
Public.

Patch Set 1 #

Patch Set 2 : Remove Lock #

Total comments: 1

Patch Set 3 : Use digest instead of hexdigest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -14 lines) Patch
M trytond/tools/misc.py View 1 2 2 chunks +30 lines, -14 lines 0 comments Download

Messages

Total messages: 5
ced1
16 years, 5 months ago (2009-12-15 11:04:29 UTC) #1
bch
On 2009/12/15 11:04:29, ced wrote: > OK
16 years, 5 months ago (2009-12-15 11:46:52 UTC) #2
yangoon1
Looks ok
16 years, 5 months ago (2009-12-15 12:00:47 UTC) #3
ced1
16 years, 5 months ago (2009-12-15 15:20:47 UTC) #4
h.goebel
16 years, 5 months ago (2009-12-15 16:24:32 UTC) #5
http://codereview.appspot.com/178050/diff/1003/5
File trytond/tools/misc.py (right):

http://codereview.appspot.com/178050/diff/1003/5#newcode523
trytond/tools/misc.py:523: 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.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b