Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (14 sloc) 0.33 kb
-module(h_rb_set).
-export([from_list/1, is_element/2]).
from_list(L) ->
lists:foldl(
fun(K, T) ->
H = erlang:phash2(K),
rbdict:append(H, K, T)
end,
rbdict:new(),
L).
is_element(Key, Tree) ->
H = erlang:phash2(Key),
Elems = rbdict:fetch(H, Tree),
lists:member(Key, Elems).
Jump to Line
Something went wrong with that request. Please try again.