[Checkins] SVN: z3c.pt/trunk/ Merged two adjacent writes into one
inside the Tag clause.
Hanno Schlichting
plone at hannosch.info
Sun Jun 15 11:27:07 EDT 2008
Log message for revision 87411:
Merged two adjacent writes into one inside the Tag clause.
Changed:
U z3c.pt/trunk/docs/HISTORY.txt
U z3c.pt/trunk/src/z3c/pt/clauses.py
-=-
Modified: z3c.pt/trunk/docs/HISTORY.txt
===================================================================
--- z3c.pt/trunk/docs/HISTORY.txt 2008-06-15 14:35:58 UTC (rev 87410)
+++ z3c.pt/trunk/docs/HISTORY.txt 2008-06-15 15:27:07 UTC (rev 87411)
@@ -4,6 +4,8 @@
Version 0.8.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- Merged two adjacent writes into one inside the Tag clause.
+
- Applied a bunch of micro-optimizations. ''.join({}) is slightly faster
than ''.join({}.keys()) and does the same. Avoid a try/except for error
handling in non-debug mode. Test against 'is None' instead of a boolean
Modified: z3c.pt/trunk/src/z3c/pt/clauses.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/clauses.py 2008-06-15 14:35:58 UTC (rev 87410)
+++ z3c.pt/trunk/src/z3c/pt/clauses.py 2008-06-15 15:27:07 UTC (rev 87411)
@@ -489,21 +489,21 @@
if unicode_required_flag:
stream.write("if isinstance(%s, unicode):" % temp)
stream.indent()
- stream.write("%s = %s.encode('utf-8')" % (temp, temp))
- stream.write("_write(' %s=\"'+_escape(%s, \"\\\"\")+'\"')" %
+ stream.write("_write(' %s=\"'+_escape("
+ "%s.encode('utf-8'), \"\\\"\")+'\"')" %
(attribute, temp))
stream.outdent()
stream.write("elif %s is not None:" % temp)
stream.indent()
- stream.write("%s = str(%s)" % (temp, temp))
- stream.write("_write(' %s=\"'+_escape(%s, \"\\\"\")+'\"')" %
+ stream.write("_write(' %s=\"'+_escape("
+ "str(%s), \"\\\"\")+'\"')" %
(attribute, temp))
stream.outdent()
else:
stream.write("if %s is not None:" % temp)
stream.indent()
- stream.write("%s = str(%s)" % (temp, temp))
- stream.write("_write(' %s=\"'+_escape(%s, \"\\\"\")+'\"')" %
+ stream.write("_write(' %s=\"'+_escape("
+ "str(%s), \"\\\"\")+'\"')" %
(attribute, temp))
stream.outdent()
More information about the Checkins
mailing list