So let's say I want to insert B at 1..=1:
AAA -> ABA
BAB -> BBB
AAB -> ABB
I am using a nodit map to keep track of physical memory in my OS. When I allocate memory I find an unused interval and then I want to mark that interval as used. The problem with insert_overwrite is that it does not merge with equal intervals before or after it, leading to the size of the NoditMap always increasing when it could be smaller because of merging.
The workaround is to use cut and then insert_merge_touching_if_values_equal, but it would be more convenient if there was a single method for this (and I think maybe it would be more performant too).
So let's say I want to insert
Bat1..=1:AAA->ABABAB->BBBAAB->ABBI am using a nodit map to keep track of physical memory in my OS. When I allocate memory I find an unused interval and then I want to mark that interval as used. The problem with
insert_overwriteis that it does not merge with equal intervals before or after it, leading to the size of the NoditMap always increasing when it could be smaller because of merging.The workaround is to use
cutand theninsert_merge_touching_if_values_equal, but it would be more convenient if there was a single method for this (and I think maybe it would be more performant too).