Skip to content

Clean up TurnCostStorage - #1945

Merged
michaz merged 8 commits into
masterfrom
sanitize-turn-restrictions
Mar 5, 2020
Merged

michaz merged 8 commits into
masterfrom
sanitize-turn-restrictions

Conversation

@michaz

@michaz michaz commented Mar 4, 2020

Copy link
Copy Markdown
Member

TurnCostStorage had several layers of read/write methods. To me, it looked like the class couldn't make up its mind if its IntRefs/Encoders should work the same way as for edges, or not. And then got stuck in the middle.

I just removed everything except one way of accessing it, namely the one that is used in production code. And adapted all the tests.

@michaz
michaz merged commit e0320fe into master Mar 5, 2020
@michaz
michaz deleted the sanitize-turn-restrictions branch March 5, 2020 06:01
* Add the specified relation to the TurnCostStorage
*/
void addRelationToTCStorage(OSMTurnRelation osmTurnRelation, IntsRef turnCostFlags,
void addRelationToTCStorage(OSMTurnRelation osmTurnRelation,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interface is generic, but OSMTurnRelation is used... Maybe redesign?
Also, turn relations can have multiple edges (which is already wrong in GH should be but is), but there... abstraction leaks even more.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants