diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2010-12-29 03:19:05 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2010-12-29 03:19:05 +0000 |
commit | 1a93bfd193c6b235a2296feff461c43ef64c1316 (patch) | |
tree | 9e848cfe2e4c4a40874cd7913cdb8bd425eaf6e4 /src/couchdb | |
parent | 3c69bd3dfb926b010d6734495ba641fe22f19997 (diff) |
Skip recursive path merging, COUCHDB-968
This patch ensures that we only ever merge a linear path into the tree.
It relies on the stemming code to collapse paths that could have been
merged together by a recursive use of merge_one.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1053518 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r-- | src/couchdb/couch_key_tree.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/couchdb/couch_key_tree.erl b/src/couchdb/couch_key_tree.erl index 985aebc0..7c84865c 100644 --- a/src/couchdb/couch_key_tree.erl +++ b/src/couchdb/couch_key_tree.erl @@ -43,7 +43,7 @@ merge_one([{Start, Tree}|Rest], {StartInsert, TreeInsert}, Acc, HasConflicts) -> case merge_at([Tree], StartInsert - Start, [TreeInsert]) of {ok, [Merged], Conflicts} -> MergedStart = lists:min([Start, StartInsert]), - merge_one(Rest, {MergedStart, Merged}, Acc, Conflicts or HasConflicts); + {ok, Rest ++ [{MergedStart, Merged} | Acc], Conflicts or HasConflicts}; no -> AccOut = [{Start, Tree} | Acc], merge_one(Rest, {StartInsert, TreeInsert}, AccOut, HasConflicts) |