Skip to content

Commit bb739b2

Browse files
author
Joe Williams
committed
empty list case of get_statistics_subset
1 parent 926a486 commit bb739b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bear.erl

+4-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ get_statistics(Values) when is_list(Values) ->
9696
{n, 0}
9797
].
9898

99-
get_statistics_subset(Values, Items) ->
99+
get_statistics_subset([_,_,_,_,_|_] = Values, Items) ->
100100
Length = length(Values),
101101
if Length < ?STATS_MIN ->
102102
[I || {K,_} = I <- get_statistics([]),
@@ -112,7 +112,9 @@ get_statistics_subset(Values, Items) ->
112112
end,
113113
report_subset(Items, Length,
114114
SortedValues, Scan_res, Scan_res2)
115-
end.
115+
end;
116+
get_statistics_subset(Values, Items) when is_list(Values) ->
117+
[{Item, 0.0} || Item <- Items].
116118

117119
calc_steps(Items) ->
118120
lists:foldl(fun({I,_},Acc) ->

0 commit comments

Comments
 (0)