**Describe the bug** The modified mergesort used to compute the weighted inverted pairs within the WeightedKendallTauDistance inefficiently uses memory.