Skip to content

core: Use a binary search for DistanceRangeMap.get#15789

Merged
hhirtz merged 3 commits intodevfrom
uber/get
Mar 31, 2026
Merged

core: Use a binary search for DistanceRangeMap.get#15789
hhirtz merged 3 commits intodevfrom
uber/get

Conversation

@hhirtz
Copy link
Copy Markdown
Member

@hhirtz hhirtz commented Mar 17, 2026

also filter empty ranges in DistanceRangeMap.putMany, otherwise during TestDistanceRangeMap.testEmptyEntry the map would end up having bounds.size==1 and values.size==0 instead of having both cleared.

@github-actions github-actions Bot added the area:core Work on Core Service label Mar 17, 2026
@hhirtz hhirtz requested review from bougue-pe and eckter March 17, 2026 16:53
Comment thread core/osrd-mp/src/commonMain/kotlin/fr/sncf/osrd/utils/DistanceRangeMapImpl.kt Outdated
otherwise during `TestDistanceRangeMap.testEmptyEntry` the map would end
up having `bounds.size==1` and `values.size==0` instead of having both
cleared.

Signed-off-by: Hubert Hirtz <hubert@hirtz.pm>
@hhirtz hhirtz force-pushed the uber/get branch 2 times, most recently from 5696203 to 7d86d8c Compare March 30, 2026 14:35
Copy link
Copy Markdown
Contributor

@bougue-pe bougue-pe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for dealing with and improving the legacy ❤️

hhirtz added 2 commits March 31, 2026 09:45
Signed-off-by: Hubert Hirtz <hubert@hirtz.pm>
Signed-off-by: Hubert Hirtz <hubert@hirtz.pm>
Copy link
Copy Markdown
Contributor

@bougue-pe bougue-pe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK to merge or to wait and push for "cleaner" bound management (but we probably won't dig on ETCS in the next 4 weeks).

@hhirtz hhirtz marked this pull request as ready for review March 31, 2026 08:23
@hhirtz hhirtz requested a review from a team as a code owner March 31, 2026 08:23
@hhirtz hhirtz added this pull request to the merge queue Mar 31, 2026
@hhirtz
Copy link
Copy Markdown
Member Author

hhirtz commented Mar 31, 2026

Opened #16020

Merged via the queue into dev with commit 6c78b00 Mar 31, 2026
29 checks passed
@hhirtz hhirtz deleted the uber/get branch March 31, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Work on Core Service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants