couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r955244 - /couchdb/trunk/src/couchdb/couch_btree.erl
Date Wed, 16 Jun 2010 14:53:06 GMT
Author: kocolosk
Date: Wed Jun 16 14:53:06 2010
New Revision: 955244

URL: http://svn.apache.org/viewvc?rev=955244&view=rev
Log:
remove unused Bt from chunkify function

Modified:
    couchdb/trunk/src/couchdb/couch_btree.erl

Modified: couchdb/trunk/src/couchdb/couch_btree.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_btree.erl?rev=955244&r1=955243&r2=955244&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_btree.erl (original)
+++ couchdb/trunk/src/couchdb/couch_btree.erl Wed Jun 16 14:53:06 2010
@@ -271,29 +271,26 @@ complete_root(Bt, KPs) ->
 % written. Plus with the "case byte_size(term_to_binary(InList)) of" code
 % it's probably really inefficient.
 
-% dialyzer says this pattern is never matched
-% chunkify(_Bt, []) ->
-%     [];
-chunkify(Bt, InList) ->
+chunkify(InList) ->
     case byte_size(term_to_binary(InList)) of
     Size when Size > ?CHUNK_THRESHOLD ->
         NumberOfChunksLikely = ((Size div ?CHUNK_THRESHOLD) + 1),
         ChunkThreshold = Size div NumberOfChunksLikely,
-        chunkify(Bt, InList, ChunkThreshold, [], 0, []);
+        chunkify(InList, ChunkThreshold, [], 0, []);
     _Else ->
         [InList]
     end.
 
-chunkify(_Bt, [], _ChunkThreshold, [], 0, OutputChunks) ->
+chunkify([], _ChunkThreshold, [], 0, OutputChunks) ->
     lists:reverse(OutputChunks);
-chunkify(_Bt, [], _ChunkThreshold, OutList, _OutListSize, OutputChunks) ->
+chunkify([], _ChunkThreshold, OutList, _OutListSize, OutputChunks) ->
     lists:reverse([lists:reverse(OutList) | OutputChunks]);
-chunkify(Bt, [InElement | RestInList], ChunkThreshold, OutList, OutListSize, OutputChunks)
->
+chunkify([InElement | RestInList], ChunkThreshold, OutList, OutListSize, OutputChunks) ->
     case byte_size(term_to_binary(InElement)) of
     Size when (Size + OutListSize) > ChunkThreshold andalso OutList /= [] ->
-        chunkify(Bt, RestInList, ChunkThreshold, [], 0, [lists:reverse([InElement | OutList])
| OutputChunks]);
+        chunkify(RestInList, ChunkThreshold, [], 0, [lists:reverse([InElement | OutList])
| OutputChunks]);
     Size ->
-        chunkify(Bt, RestInList, ChunkThreshold, [InElement | OutList], OutListSize + Size,
OutputChunks)
+        chunkify(RestInList, ChunkThreshold, [InElement | OutList], OutListSize + Size, OutputChunks)
     end.
 
 modify_node(Bt, RootPointerInfo, Actions, QueryOutput) ->
@@ -336,7 +333,7 @@ get_node(#btree{fd = Fd}, NodePos) ->
 
 write_node(Bt, NodeType, NodeList) ->
     % split up nodes into smaller sizes
-    NodeListList = chunkify(Bt, NodeList),
+    NodeListList = chunkify(NodeList),
     % now write out each chunk and return the KeyPointer pairs for those nodes
     ResultList = [
         begin



Mime
View raw message