**Describe the bug** The modified mergesort used to compute the number of inverted pairs within the KendallTauDistance inefficiently uses memory.