Merge branch 'master' into new-gui

This commit is contained in:
Reinier Balt 2013-07-29 12:37:20 +02:00
commit 41ff0e20ae
2 changed files with 23 additions and 1 deletions

View file

@ -377,7 +377,7 @@ class StatsController < ApplicationController
# the block should return an array of indexes each is added to the hash and summed
def convert_to_array(records, upper_bound)
a = Array.new(upper_bound, 0)
records.each { |r| (yield r).each { |i| a[i] += 1 } }
records.each { |r| (yield r).each { |i| a[i] += 1 if a[i] } }
a
end