Use hashset to dedupe plugin names from Lang #1072
Merged
+22
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was changed
Use HashSet instead of Vec for plugins
Why?
To better enforce deduping duplicate plugin names. Note, due to Version being a part of the struct, this doesn't fully dedupe plugins with the same names (when they have different versions), but it still helps.
Checklist
Closes
How was this tested:
Note
Replace plugin list with a HashSet across worker config/bridge and sort by name when emitting heartbeats; update tests accordingly.
WorkerConfig.pluginsfromVec<PluginInfo>toHashSet<PluginInfo>incrates/common/src/worker.rs.pluginsinput toHashSet<_>and buildHashSet<PluginInfo>incrates/sdk-core-c-bridge/src/worker.rs.namebefore sending inWorkerHeartbeatincrates/sdk-core/src/worker/mod.rs.worker_heartbeat_tests.rsto pass plugins asHashSet<PluginInfo>.Written by Cursor Bugbot for commit 481543d. This will update automatically on new commits. Configure here.