[Vala] [suggestion] Make lambda generated func inline(performance)




I thought on this simple suggestion:
Whenever lambda expression exist, Vala translate it to func:
static (type) __lambda4_ ([args]) {
...
}

Lambda expression is used for callback, but Vala always produce
another func which is the real callback, which call lambda func
(maybe for allowing user data).
So why don't generate lambda func as inline?
It can never be recurs, so it's safe.

BTW: I recommend you to give a tip in Vala/Tutorial that if anyone
prefer to use a method instead of lambda for signal, make this
method inline for the same reason, unless this method has also a
different purpose, which inline is a bad idea.

Tal
                                          


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