Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

foldl and foldr already defined in dict-api branch

  • Loading branch information...
commit 5241cdb811fbe54cf8a4b4536cf47e65bd614004 1 parent a8d5896
Richard Carlsson authored
Showing with 1 addition and 31 deletions.
  1. +1 −31 lib/stdlib/src/gb_trees.erl
View
32 lib/stdlib/src/gb_trees.erl
@@ -117,7 +117,7 @@
update/3, enter/3, delete/2, delete_any/2, balance/1,
is_defined/2, keys/1, values/1, to_list/1, range/2, from_orddict/1,
smallest/1, largest/1, take_smallest/1, take_largest/1,
- iterator/1, iterator/2, next/1, map/2, foldl/3, foldr/3]).
+ iterator/1, iterator/2, next/1, map/2]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -610,33 +610,3 @@ map(F, {Size, Tree}) when is_function(F, 2) ->
map_1(_, nil) -> nil;
map_1(F, {K, V, Smaller, Larger}) ->
{K, F(K, V), map_1(F, Smaller), map_1(F, Larger)}.
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
--spec foldl(Function, Acc, Tree1) -> Tree2 when
- Function :: fun((K :: term(), V1 :: term(), Acc) -> V2 :: term()),
- Acc :: term(),
- Tree1 :: gb_tree(),
- Tree2 :: gb_tree().
-
-foldl(F, Acc, {_, Tree}) when is_function(F, 3) ->
- foldl_1(F, Acc, Tree).
-
-foldl_1(_, Acc, nil) -> Acc;
-foldl_1(F, Acc, {K, V, Smaller, Larger}) ->
- foldl_1(F, F(K, V, foldl_1(F, Acc, Smaller)), Larger).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
--spec foldr(Function, Acc, Tree1) -> Tree2 when
- Function :: fun((K :: term(), V1 :: term(), Acc) -> V2 :: term()),
- Acc :: term(),
- Tree1 :: gb_tree(),
- Tree2 :: gb_tree().
-
-foldr(F, Acc, {_, Tree}) when is_function(F, 3) ->
- foldr_1(F, Acc, Tree).
-
-foldr_1(_, Acc, nil) -> Acc;
-foldr_1(F, Acc, {K, V, Smaller, Larger}) ->
- foldr_1(F, F(K, V, foldr_1(F, Acc, Larger)), Smaller).

0 comments on commit 5241cdb

Please sign in to comment.
Something went wrong with that request. Please try again.