Skip to content

detecting duplicate labels during .list processing #661

@yakra

Description

@yakra

When processing .list lines, each label is looked up in at least 2 hash tables:

  1. Route::duplicate_labels
  2. Route::pri_label_hash
  3. Route::alt_list_hash, if not found in pri_label_hash

Instead:

  • Nix Route::duplicate_labels. This will also save a good chunk of RAM added up over all Routes.
  • When we detect a duplicate creating label hashes, set the label's value in Route::pri_label_hash to -1 (AKA 4294967295).
  • When parsing .list lines, as soon as we get our iterators back from looking up both labels, check for an index of -1.
    Nope, gotta do it the same place we already do, to ensure both iterators are valid (not end()).
  • Then do what we do now -- userlog notification and continue;
  • A lambda can cut down on boilerplate. We have the same block of code twice each in both the 4-field & 6-field routines.

Since a good chunk of mark_connected_route_segments.cpp will get shuffled around to enable 6-field support for hidden systems, it makes sense to do this now.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions