summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_view.erl
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2009-11-21 13:43:43 +0000
committerAdam Kocoloski <kocolosk@apache.org>2009-11-21 13:43:43 +0000
commitaef9dbd3a6cbb85085023d3c8565740e09fd6a77 (patch)
tree7ee342a14f36f7a21b2249b832c9700f082d55b6 /src/couchdb/couch_view.erl
parent9c97bb531ed9b5d6fc18fcef87a6742514e984d5 (diff)
code improvements from tidier. Patch by Kostis Sagonas. COUCHDB-570
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@882903 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_view.erl')
-rw-r--r--src/couchdb/couch_view.erl16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/couchdb/couch_view.erl b/src/couchdb/couch_view.erl
index 778756ef..f80ce434 100644
--- a/src/couchdb/couch_view.erl
+++ b/src/couchdb/couch_view.erl
@@ -89,9 +89,9 @@ cleanup_index_files(Db) ->
RegExp = "("++ string:join(Sigs, "|") ++")",
% filter out the ones in use
- DeleteFiles = lists:filter(fun(FilePath) ->
- re:run(FilePath, RegExp, [{capture, none}]) == nomatch
- end, FileList),
+ DeleteFiles = [FilePath
+ || FilePath <- FileList,
+ re:run(FilePath, RegExp, [{capture, none}]) =:= nomatch],
% delete unused files
?LOG_DEBUG("deleting unused view index files: ~p",[DeleteFiles]),
[file:delete(File)||File <- DeleteFiles],
@@ -369,12 +369,10 @@ less_json_ids({JsonA, IdA}, {JsonB, IdB}) ->
less_json(A, B) ->
TypeA = type_sort(A),
TypeB = type_sort(B),
- if
- TypeA == TypeB ->
- Less = less_same_type(A,B),
- Less;
- true ->
- TypeA < TypeB
+ if TypeA == TypeB ->
+ less_same_type(A, B);
+ true ->
+ TypeA < TypeB
end.
type_sort(V) when is_atom(V) -> 0;