Slightly faster code for computing slickgrid totals