gwt /
gwt /
6c23880156f1e2e524b956cc204a95d613d8b195 Rewrites some if statements into boolean expressions.
if (<cond>) { <expr_stmt>; } => <cond> && <expr_stmt>
if (<cond>) { <then_expr_stmt>; } else { <else_expr_stmt>; } =>
<cond> ? <then_expr_stmt> : <else_expr_stmt>
Also supports lifting return statement:
if (<cond>) { return <expr1>; } else { return <expr2>; } =>
return <cond>?<expr1>:<expr2>;
Reduces code size by a tiny amout (approx. 0.5%) mostly because this optimization create a lot of opportunities for inliner to kick in.
Patch by: mike.aizatsky
Review by: me, spoon
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@6533 8db76d5a-ed1c-0410-87a9-c151d255dfc7
5 files changed