For replication reasons, implementations of the SummarisableStorage interface need to handle ranges whose end is less than their start by treating the order of keys as cyclic. This leads to duplicated logic across different implementations. It might be nicer to require the methods of SummarisableStorage to be invoked with well-formed ranges (start <= end) only, and add a set of conversion functions from weird ranges to pairs of well-formed ranges.
For replication reasons, implementations of the SummarisableStorage interface need to handle ranges whose end is less than their start by treating the order of keys as cyclic. This leads to duplicated logic across different implementations. It might be nicer to require the methods of SummarisableStorage to be invoked with well-formed ranges (
start <= end
) only, and add a set of conversion functions from weird ranges to pairs of well-formed ranges.