[erlang-questions] Efficiency is passing a functin
Sun Sep 23 03:37:58 CEST 2012
On 09/22/2012 05:07 PM, James Rosenblum wrote:
> Kind people,
> Is there an appreciable difference in these two ways of passing a function?
> F = fun(A,B) -> my_function(A,B) end.
> lists:map(F, Lst)
> lists:map(fun my_function/2, Lst)
"Calls to local or external functions are the fastest kind of calls."
So, the second solution is best.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions