Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

foldl and foldr already defined in dict-api branch

  • Loading branch information...
commit 5241cdb811fbe54cf8a4b4536cf47e65bd614004 1 parent a8d5896
Richard Carlsson authored

Showing 1 changed file with 1 addition and 31 deletions. Show diff stats Hide diff stats

  1. +1 31 lib/stdlib/src/gb_trees.erl
32 lib/stdlib/src/gb_trees.erl
@@ -117,7 +117,7 @@
117 117 update/3, enter/3, delete/2, delete_any/2, balance/1,
118 118 is_defined/2, keys/1, values/1, to_list/1, range/2, from_orddict/1,
119 119 smallest/1, largest/1, take_smallest/1, take_largest/1,
120   - iterator/1, iterator/2, next/1, map/2, foldl/3, foldr/3]).
  120 + iterator/1, iterator/2, next/1, map/2]).
121 121
122 122
123 123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -610,33 +610,3 @@ map(F, {Size, Tree}) when is_function(F, 2) ->
610 610 map_1(_, nil) -> nil;
611 611 map_1(F, {K, V, Smaller, Larger}) ->
612 612 {K, F(K, V), map_1(F, Smaller), map_1(F, Larger)}.
613   -
614   -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
615   -
616   --spec foldl(Function, Acc, Tree1) -> Tree2 when
617   - Function :: fun((K :: term(), V1 :: term(), Acc) -> V2 :: term()),
618   - Acc :: term(),
619   - Tree1 :: gb_tree(),
620   - Tree2 :: gb_tree().
621   -
622   -foldl(F, Acc, {_, Tree}) when is_function(F, 3) ->
623   - foldl_1(F, Acc, Tree).
624   -
625   -foldl_1(_, Acc, nil) -> Acc;
626   -foldl_1(F, Acc, {K, V, Smaller, Larger}) ->
627   - foldl_1(F, F(K, V, foldl_1(F, Acc, Smaller)), Larger).
628   -
629   -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
630   -
631   --spec foldr(Function, Acc, Tree1) -> Tree2 when
632   - Function :: fun((K :: term(), V1 :: term(), Acc) -> V2 :: term()),
633   - Acc :: term(),
634   - Tree1 :: gb_tree(),
635   - Tree2 :: gb_tree().
636   -
637   -foldr(F, Acc, {_, Tree}) when is_function(F, 3) ->
638   - foldr_1(F, Acc, Tree).
639   -
640   -foldr_1(_, Acc, nil) -> Acc;
641   -foldr_1(F, Acc, {K, V, Smaller, Larger}) ->
642   - 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.