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

Modernise several uses of GetSortedLanes() #1490

Merged
merged 8 commits into from
Mar 27, 2022

Conversation

originalfoo
Copy link
Member

Got tired of seeing the obsolete warnings on big chunks of extSegmentManager.GetSortedLanes() so started porting some over to the newer NetSegment extension.

I'm doing these by hand as there seems to be lots of little fringe issues in code where GetSortedLanes() is used - for example, sometimes we don't need the lanes sorting (eg. if we're just counting the number of returned lanes).

@originalfoo originalfoo added the code cleanup Refactor code, remove old code, improve maintainability label Mar 24, 2022
@originalfoo originalfoo added this to the 11.6.5.2 milestone Mar 24, 2022
@originalfoo originalfoo self-assigned this Mar 24, 2022
@kianzarrin
Copy link
Collaborator

code looks good.

laneTypeFilter: SpeedLimitManager.LANE_TYPES,
vehicleTypeFilter: SpeedLimitManager.VEHICLE_TYPES,
sort: false).Count;
int count0 = segmentId0.ToSegment().GetSortedLanes(
Copy link
Member

Choose a reason for hiding this comment

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

Double ToSegment() call

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't sure what to do here because we can't store ref in an enumerable.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, ok true, I didn't check in the IDE, ignore

TLM/TLM/Manager/Impl/VehicleRestrictionsManager.cs Outdated Show resolved Hide resolved
originalfoo and others added 2 commits March 27, 2022 23:37
Copy link
Member

@krzychu124 krzychu124 left a comment

Choose a reason for hiding this comment

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

Ok 👍

@originalfoo originalfoo merged commit 88402cc into master Mar 27, 2022
@originalfoo originalfoo deleted the sorted-lanes-modernisation1 branch March 27, 2022 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Refactor code, remove old code, improve maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants