My understanding is that the current implementation just adds returns at the correct places to make it appear like an if statement at the end of a method is a pseudo expression. So if you just move the whole if statement into a private method and call that in the declaration statement, everything else might come for free.
Cheers, Paul. On Wed, Sep 27, 2017 at 10:30 PM, Daniel Sun <realblue...@hotmail.com> wrote: > Hi Paul, > > I have not investigated the bytecode generation of if statement, so I > just provide a reference implementation ;) > > It's better to implement at the bytecode level(both static and > dynamic). > > > Cheers, > Daniel.Sun > > > > -- > Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html >