Skip to content

smash case #319

Description

@yakra
  • For every AltLabel in every point not matching a primary waypoint label (most of the time) in every valid region/highway combo in every .list, we smash case 3 times:

    1. .lower() to compare to list labels
    2. .upper() to add to labels_in_use
    3. .upper() to check membership in unused_alt_labels & remove/erase

    Removing this redundancy can gain us some efficiency and clean up the code pending hash tables for waypoint labels? #278.


  • Similarly, for every valid region/highway combo, we smash case on all alt_route_names until we match route_entry.

    Removing this redundancy can gain us some efficiency and clean up the code pending Output log for unused altRouteNames #230.


To be addressed in tandem with #316.

  • Handle that first and squash commits.

ToDo:

  • .upper() all alt_labels at once during Waypoint construction
  • .strip('+') here too
  • populate unused alt labels: don't smash case or .strip('+') anymore
  • clean up alt_labels handling in TravelerList ctor
  • .upper() all alt_route_names at once during Route construction
  • don't smash case in TravelerList ctor (one line above Note: deprecated route name)
  • clean up DUPLICATE_LABEL datacheck
  • similarly .lower() root during Route construction
  • make sure not lowered again during root_hash insertion
  • .lower() all roots at once during ConnectedRoute construction
  • change .lower() to .upper() as appropriate (not roots) globally

Similarly:
Another idea that may help speed up .list processing:

  • Store an upper_label pre-stripped of leading + or * characters for each Waypoint upon construction, to avoid having to repeat this process every time we iterate through a route for a valid region/highway combo.
    Maybe this is a bit rich for my blood though, if the eventual idea is to implement hash tables for waypoint labels? #278.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions