Optimisation CharFrequency -> compareTo