Optimize use of pseudo-counts in tight loop