Ultimately that'd be great, whether that's a one step operation or a two-step.
On Wed, Jun 10, 2009 at 7:16 PM, Ray Cromwell <[email protected]> wrote: > > Scott, do you mean replacing > > if(a != null) { expr; } > > with > > a && expr? > > -Ray > > > On Thu, Jun 11, 2009 at 4:56 AM, <[email protected]> wrote: > > > > LGTM. Want to point out that we can optimize some of these even better > > in cases where the nested code is an expression statement. > > > > > > http://gwt-code-reviews.appspot.com/33845/diff/1/2 > > File dev/core/test/com/google/gwt/dev/js/JsStaticEvalTest.java (right): > > > > http://gwt-code-reviews.appspot.com/33845/diff/1/2#newcode37 > > Line 37: assertEquals("if(!a()){b()}", optimize("if (a()) { } else { > > b(); }")); > > a()||b() > > > > http://gwt-code-reviews.appspot.com/33845/diff/1/2#newcode45 > > Line 45: assertEquals("if(a()){b()}", optimize("if (a()) { b() } else { > > }")); > > a()&&b() > > > > http://gwt-code-reviews.appspot.com/33845 > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
