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