[Python-checkins] r64917 - python/branches/tlee-ast-optimize/Python/optimize.c
thomas.lee
python-checkins at python.org
Sun Jul 13 17:16:37 CEST 2008
Author: thomas.lee
Date: Sun Jul 13 17:16:36 2008
New Revision: 64917
Log:
Added a comment describing the if/else translation for tests with a unary not.
Modified:
python/branches/tlee-ast-optimize/Python/optimize.c
Modified: python/branches/tlee-ast-optimize/Python/optimize.c
==============================================================================
--- python/branches/tlee-ast-optimize/Python/optimize.c (original)
+++ python/branches/tlee-ast-optimize/Python/optimize.c Sun Jul 13 17:16:36 2008
@@ -1314,6 +1314,9 @@
if (!optimize_stmt_seq(opt, &stmt->v.If.orelse))
return 0;
+ /* BEFORE: if not <A>: <B>; else: <C>
+ * AFTER: if <A>: <C>; else: <B>
+ */
if (stmt->v.If.test->kind == UnaryOp_kind &&
stmt->v.If.test->v.UnaryOp.op == Not) {
asdl_seq* body = stmt->v.If.orelse;
More information about the Python-checkins
mailing list