[CountDiff.rb] count_diff_order optimization