From 0e4b0ae7ce57117a561f70fa51026d85b4702aaa Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Wed, 4 Sep 2013 14:08:34 +0100 Subject: Add dict:is_empty/1 and orddict:is_empty/1 dict:size/1 runs in constant time, but orddict:size/1 does not. With this change, the two modules stay API compatible and gain a constant-time function for checking whether a dictionary is empty. --- lib/stdlib/test/dict_test_lib.erl | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/stdlib/test/dict_test_lib.erl') diff --git a/lib/stdlib/test/dict_test_lib.erl b/lib/stdlib/test/dict_test_lib.erl index e308fd0721..4fdb4fa0bd 100644 --- a/lib/stdlib/test/dict_test_lib.erl +++ b/lib/stdlib/test/dict_test_lib.erl @@ -28,6 +28,7 @@ new(Mod, Eq) -> (from_list, L) -> from_list(Mod, L); (module, []) -> Mod; (size, D) -> Mod:size(D); + (is_empty, D) -> Mod:is_empty(D); (to_list, D) -> to_list(Mod, D) end. -- cgit v1.2.3