diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2010-06-16 16:49:36 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2010-06-16 16:49:36 +0000 |
commit | 78017574afd5796316a9f68cfc7f369e125fa36c (patch) | |
tree | 49cd3bbc3ff373625962ed5cd9469a51475ecb54 /src/couchdb/couch_btree.erl | |
parent | 4ccf61a343c2437fb574bf00e4e3da5e48e17548 (diff) |
small optimization for reordering result lists
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@955297 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_btree.erl')
-rw-r--r-- | src/couchdb/couch_btree.erl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/couchdb/couch_btree.erl b/src/couchdb/couch_btree.erl index d9eba774..0e47bac7 100644 --- a/src/couchdb/couch_btree.erl +++ b/src/couchdb/couch_btree.erl @@ -13,7 +13,7 @@ -module(couch_btree). -export([open/2, open/3, query_modify/4, add/2, add_remove/3]). --export([fold/4, full_reduce/1, final_reduce/2,foldl/3,foldl/4]). +-export([fold/4, full_reduce/1, final_reduce/2, foldl/3, foldl/4]). -export([fold_reduce/4, lookup/2, get_state/1, set_options/2]). -define(CHUNK_THRESHOLD, 16#4ff). @@ -203,8 +203,7 @@ lookup(#btree{root=Root, less=Less}=Bt, Keys) -> % We want to return the results in the same order as the keys were input % but we may have changed the order when we sorted. So we need to put the % order back into the results. - KeyDict = dict:from_list(SortedResults), - [dict:fetch(Key, KeyDict) || Key <- Keys]. + couch_util:reorder_results(Keys, SortedResults). lookup(_Bt, nil, Keys) -> {ok, [{Key, not_found} || Key <- Keys]}; |