if (symbol % 2 == 0) /* if even, prev cum is ok, update cum */ { current_pair = *freq_ptr; high_half = (unsigned char)((current_pair & HIGH_MASK) >> HIGH_SHIFT); high_half_weight = translate[high_half]; cum = prev_cum + high_half_weight; } else /* if odd, update both */ { current_pair = *freq_ptr; total_pair_weight = both_weights[current_pair]; cum = prev_cum + total_pair_weight; high_half = (unsigned char)((current_pair & HIGH_MASK) >> HIGH_SHIFT); high_half_weight = translate[high_half]; prev_cum += high_half_weight; } /* end updating */