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

Convert TraverseState::new_goals and TraverseState::removed_goals into std::vector and push/pop instead of insert/erase. #1856

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

copybara-service[bot]
Copy link

Convert TraverseState::new_goals and TraverseState::removed_goals into std::vector and push/pop instead of insert/erase.

These containers were never used to check set membership during the loop, it was practically being used to later construct a set after the algorithm, of which in previous state of the code it made sense(because it was being copied all over the place), but while traversing the problem space through DFS it doesn't make sense just because pushing and poping on a std::vector is way more cheaper than insertion and deletion within a std::set, as we only want to remember the increment of the state change between DFSs.

… into `std::vector` and push/pop instead of insert/erase.

These containers were never used to check set membership during the loop, it was practically being used to later construct a set after the algorithm, of which in previous state of the code it made sense(because it was being copied all over the place), but while traversing the problem space through DFS it doesn't make sense just because pushing and poping on a `std::vector` is way more cheaper than insertion and deletion within a `std::set`, as we only want to remember the increment of the state change between DFSs.

PiperOrigin-RevId: 707890975
@copybara-service copybara-service bot merged commit cdc2776 into main Dec 19, 2024
1 check passed
@copybara-service copybara-service bot deleted the cl/707443325 branch December 19, 2024 14:17
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.

1 participant