efficiency, deep lists

Ulf Wiger etxuwig@REDACTED
Tue Oct 2 17:44:24 CEST 2001


On Tue, 2 Oct 2001, Ulf Wiger wrote:

>get_values2([Key|Keys]) ->
>   get_vals2(Key, fun() -> get_values2(Keys) end);
>get_values2([]) ->
>   [].
>
>get_vals2(Key, Cont) ->
>    [{_, Points}] = ets:lookup(mytab, Key),
>    get_values2(Points, Cont).
>
>get_values2([{point, Value}|Points], Cont) -> 
>    [Value | get_values2(Points, Cont)];
>get_values2([], Cont) ->
>    Cont().


Never mind the weird choice of function names. It was a quick
copy-and-paste job to change the original names to something more
general.... I should have left it as it was.

/Uffe
-- 
Ulf Wiger                                    tfn: +46  8 719 81 95
Senior System Architect                      mob: +46 70 519 81 95
Strategic Product & System Management    ATM Multiservice Networks
Data Backbone & Optical Services Division      Ericsson Telecom AB




More information about the erlang-questions mailing list