Skip to content

Why not one Route::label_hash? #215

Open

Description

@yakra

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

Activity

  1. yakra commented on Apr 30, 2022

    @yakra
    OwnerAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions