Merged
Conversation
Contributor
Author
|
should we pin clippy for the bins to |
Member
yep, done here #11401 |
mattsse
requested changes
Oct 2, 2024
| /// If the index is out of bounds. | ||
| pub fn remove_peer(&mut self, index: usize) -> Peer<C, Pool> { | ||
| self.peers.remove(index) | ||
| self.peers.swap_remove(index) |
Collaborator
There was a problem hiding this comment.
this we can't do because this messes with the ordering
Contributor
Author
There was a problem hiding this comment.
oh ok, didn't know peers ordering was important, will revert
| } | ||
|
|
||
| let sealed_target = headers.remove(0).seal_slow(); | ||
| let sealed_target = headers.swap_remove(0).seal_slow(); |
Collaborator
There was a problem hiding this comment.
this is fine because we only need the first one and aren't using it anymore
|
|
||
| if keep_alive == KeepPayloadJobAlive::No { | ||
| let (_, id) = self.payload_jobs.remove(job); | ||
| let (_, id) = self.payload_jobs.swap_remove(job); |
Collaborator
There was a problem hiding this comment.
this is also fine because we always find the index first and the ordering doesn't matter
greged93
commented
Oct 2, 2024
mattsse
approved these changes
Oct 2, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces remove with swap_remove for optimized removal of items in a Vec where preservation of order of the items isn't needed.