couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [22/30] bear commit: updated refs/heads/import-master to 5f99806
Date Thu, 31 Jul 2014 21:10:13 GMT
empty list case of get_statistics_subset


Project: http://git-wip-us.apache.org/repos/asf/couchdb-bear/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-bear/commit/bb739b29
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-bear/tree/bb739b29
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-bear/diff/bb739b29

Branch: refs/heads/import-master
Commit: bb739b294c0892933978b7ab5d7e316d6855cdcb
Parents: 926a486
Author: Joe Williams <joe.williams@github.com>
Authored: Tue Nov 5 12:51:06 2013 -0800
Committer: Joe Williams <joe.williams@github.com>
Committed: Tue Nov 5 12:51:06 2013 -0800

----------------------------------------------------------------------
 src/bear.erl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-bear/blob/bb739b29/src/bear.erl
----------------------------------------------------------------------
diff --git a/src/bear.erl b/src/bear.erl
index 39111f5..d46aa8a 100644
--- a/src/bear.erl
+++ b/src/bear.erl
@@ -96,7 +96,7 @@ get_statistics(Values) when is_list(Values) ->
      {n, 0}
     ].
 
-get_statistics_subset(Values, Items) ->
+get_statistics_subset([_,_,_,_,_|_] = Values, Items) ->
     Length = length(Values),
     if Length < ?STATS_MIN ->
 	    [I || {K,_} = I <- get_statistics([]),
@@ -112,7 +112,9 @@ get_statistics_subset(Values, Items) ->
 			end,
 	    report_subset(Items, Length,
 			  SortedValues, Scan_res, Scan_res2)
-    end.
+    end;
+get_statistics_subset(Values, Items) when is_list(Values) ->
+    [{Item, 0.0} || Item <- Items].
 
 calc_steps(Items) ->
     lists:foldl(fun({I,_},Acc) ->


Mime
View raw message