I thought I'd go ahead and commit what you have so far, if you don't object?

On Wed, Jun 10, 2009 at 4:12 PM, <[email protected]> wrote:

> I'll update the patch with this change.  While I'm at it, I may as well
> tackle this one too:
>
> if (test) {a()} else {b()} -> test?a():b()
>
>
> On 2009/06/10 19:56:18, scottb 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to