Change hasattr to has_key in DT_String.py String::__call__
Bug #143213 reported by
Ken Brush
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Low
|
Unassigned |
Bug Description
the mapping object is always a dictionary, has_key is much faster than hasattr in this case. This patch improves performance, slightly.
Changed in zope2: | |
status: | New → Triaged |
tags: |
added: bugday removed: bug+solution zope |
To post a comment you must log in.
I believe some assumptions here are wrong. The fact that "taintWrapper" is looked for at all insinuates that the mapping object may be a REQUEST object, which has the method "taintWrapper". Since it is a method, lookup via "hasattr" is correct.