// Update partial stats or frequency of most frequent pair is less than saved minimum for partial stats
if update_partial_stats or freq <= partial_stats_min:
partial_stats_min = partial_stats.most_common(500)[-1][1]
partial_stats = Counter()
for k, v in stats.most_common():
if v < partial_stats_min:
After Change
// Update partial stats or frequency of most frequent pair is less than saved minimum for partial stats
if update_partial_stats or freq < partial_stats_min:
partial_stats_min = stats.most_common(500)[-1][1]
partial_stats = Counter()
for k, v in stats.most_common():
if v < partial_stats_min: