Skip to content

Add a method to insert, overwriting the interval and merging if touching values are equal. #62

@ChocolateLoverRaj

Description

@ChocolateLoverRaj

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions