lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> In the absence of a code review, would anyone know the purpose of the
> `break` keyword handling in the `test_then_block` method?  I am curious to
> know what that does so I know whether to modify it or not.  From what I can
> see, the `continue` keyword seems to work properly whether I update that
> method or not, so I'm wondering if it is simply some kind of optimization
> for special cases.

Yes, it is an optimization for the case "if cond then break ...". Without
the optimization, the "if" would jump around 'break' when the condition
is false. With the optimization, the "if" jumps straight to the end of
the loop when the condition is true.

-- Roberto