Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not one Route::label_hash? #215

Open
3 tasks
yakra opened this issue Mar 21, 2022 · 1 comment
Open
3 tasks

Why not one Route::label_hash? #215

yakra opened this issue Mar 21, 2022 · 1 comment

Comments

@yakra
Copy link
Owner

yakra commented Mar 21, 2022

Separate pri_label_hash and alt_label_hash make sense so we can get Note: deprecated route name in userlogs.
(Although, a single std::unordered_map<std::string,std::pair<Route*,bool>> with the bool distinguishing primary/alt might do the trick.)

But there's no such notification for AltLabels.
Could one hash should be sufficient?
Seems so, quickly looking at route_integrity.cpp & mark_*_route_segments.cpp.
Should be able to greatly simplify the insertion process in route_integrity.

  • OT: and while in there, convert those #defines to references.

Thought experiment: What happen{s,ed} with duplicate labels 1 pri + 1 alt, WRT the "unused" set & everything else...

@yakra
Copy link
Owner Author

yakra commented Apr 30, 2022

Going to only one label_hash saves only a tiny sliver of time. As in, 0.08s tops, 1 thread on lab3.
It would remove an opportunity to easily implement a who-uses-what-alt-labels log.

Not sure how much we actually want one right now...
si404 got the "Equivalent waypoint labels mark zero distance traveled in line: " .log notice
mapcat got unusedaltlabels.log
That takes care of the specific concerns they mentioned, but we may want one for other reasons at some point.
So why not leave this ability in place, in case we may want to use it in the future.

Sure, I could use std::pair<Route*,bool> as a mapped type, but result.first->second->first to get a Route* from an insertion result? Yeesh...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant