You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/07 17:38:05 UTC
[43/50] couch commit: updated refs/heads/windsor-merge to 6e60cbe
Update old function specs to be correct
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/d75dca18
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/d75dca18
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/d75dca18
Branch: refs/heads/windsor-merge
Commit: d75dca18e3fe1914381f071edf65e5b9b1e7aab3
Parents: d3937f5
Author: Benjamin Bastian <be...@gmail.com>
Authored: Thu Jan 23 14:27:53 2014 -0800
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Aug 6 17:36:36 2014 +0100
----------------------------------------------------------------------
src/couch_key_tree.erl | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/d75dca18/src/couch_key_tree.erl
----------------------------------------------------------------------
diff --git a/src/couch_key_tree.erl b/src/couch_key_tree.erl
index 1659547..9ad6f7f 100644
--- a/src/couch_key_tree.erl
+++ b/src/couch_key_tree.erl
@@ -90,7 +90,8 @@ merge(RevTree, Tree) ->
%% @doc Attempt to merge Tree into each branch of the RevTree.
%% If it can't find a branch that the new tree merges into, add it as a
%% new branch in the RevTree.
--spec merge_tree(revtree(), tree(), revtree()) -> {revtree(), boolean()}.
+-spec merge_tree(revtree(), tree(), revtree()) ->
+ {revtree(), new_leaf | new_branch | internal_node}.
merge_tree([], Tree, []) ->
{[Tree], new_leaf};
merge_tree([], Tree, MergeAcc) ->
@@ -122,7 +123,8 @@ merge_tree([{Depth, Nodes} | Rest], {IDepth, INodes}=Tree, MergeAcc) ->
%% before we can start comparing node keys. If one of the branches
%% ends up running out of nodes we know that these two branches can
%% not be merged.
--spec merge_at([node()], integer(), [node()]) -> {revtree(), boolean()} | fail.
+-spec merge_at([node()], integer(), [node()]) ->
+ {revtree(), new_leaf | new_branch | internal_node} | fail.
merge_at(_Nodes, _Pos, []) ->
fail;
merge_at([], _Pos, _INodes) ->
@@ -164,7 +166,8 @@ merge_at([Tree | Sibs], 0, INodes) ->
fail -> fail
end.
--spec merge_extend(tree(), tree()) -> {tree(), atom()}.
+-spec merge_extend(tree(), tree()) ->
+ {tree(), new_leaf | new_branch | internal_node}.
merge_extend([], B) when B =/= [] ->
% Most likely the insert branch simply extends this one, so the new
% branch is exactly B. Its also possible that B is a branch because