diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-07-11 10:31:38 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-07-11 10:31:38 +0000 |
commit | f5f04686b010d6326e88cfafcdc6629560c36d0d (patch) | |
tree | cee8c99fce55826f27b89e954281d3318feca774 | |
parent | d4446bfb78a2f5f9049e5aa52f2927769e239286 (diff) |
Removing unnecessary code.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@963042 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/couchdb/couch_util.erl | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/couchdb/couch_util.erl b/src/couchdb/couch_util.erl index ff4cbe36..252d4e04 100644 --- a/src/couchdb/couch_util.erl +++ b/src/couchdb/couch_util.erl @@ -144,18 +144,11 @@ get_nested_json_value(Value, []) -> get_nested_json_value(_NotJSONObj, _) -> throw({not_found, json_mismatch}). -proplist_apply_field(H, L) -> - {R} = json_apply_field(H, {L}), - R. - -json_apply_field(H, {L}) -> - json_apply_field(H, L, []). -json_apply_field({Key, NewValue}, [{Key, _OldVal} | Headers], Acc) -> - json_apply_field({Key, NewValue}, Headers, Acc); -json_apply_field({Key, NewValue}, [{OtherKey, OtherVal} | Headers], Acc) -> - json_apply_field({Key, NewValue}, Headers, [{OtherKey, OtherVal} | Acc]); -json_apply_field({Key, NewValue}, [], Acc) -> - {[{Key, NewValue}|Acc]}. +proplist_apply_field({K, _V} = KV, L) -> + lists:keystore(K, 1, L, KV). + +json_apply_field({K, _V} = KV, {L}) -> + {lists:keystore(K, 1, L, KV)}. json_user_ctx(#db{name=DbName, user_ctx=Ctx}) -> {[{<<"db">>, DbName}, |