There is only a single case when the active range is assigned(!), which is the first time a range is registered.
That being said, the active range should be handled more carefully than just "whenever a new range is registered" however (i.e. should not simply add an else condition to the if block that currently checks for the active range being None)
Care should be taken in particular for the procedure that occurs during overlap handling so that the re-assigned "old" range in the case where a head overlap induces an overwrite (illustrated in #15 as [c,g]⇢[d,g])
First the old entry should be removed
Second the replacement for the old entry should be registered
Third the new entry should be registered
...actually it would be fine to just change the active range whenever a new one is added [and thus registered] but it means the order now matters (simply implement as listed above).
Another issue to be aware of is that if removal of an active range becomes possible (as in the 1st step listed in the scenario above) then the active range must be reset too, and therefore removing a range must only take place when adding a new range. Otherwise, the active range may be left unset.
There is only a single case when the active range is assigned(!), which is the first time a range is registered.
That being said, the active range should be handled more carefully than just "whenever a new range is registered" however (i.e. should not simply add an else condition to the if block that currently checks for the active range being
None
)Care should be taken in particular for the procedure that occurs during overlap handling so that the re-assigned "old" range in the case where a head overlap induces an overwrite (illustrated in #15 as
[c,g]
⇢[d,g]
)...actually it would be fine to just change the active range whenever a new one is added [and thus registered] but it means the order now matters (simply implement as listed above).
Another issue to be aware of is that if removal of an active range becomes possible (as in the 1st step listed in the scenario above) then the active range must be reset too, and therefore removing a range must only take place when adding a new range. Otherwise, the active range may be left unset.