Skip to content

Conversation

@AriajSarkar
Copy link
Contributor

Description

This PR addresses the optimization suggested in #801 and implements the TODO left in #787.

It removes the redundant checked_add call in try_reserve. Since we are checking self.len() + additional <= self.capacity(), and additional is a legitimate increment for the internal storage, the overflow check is unnecessary and adding it was a defensive but redundant step.

Related Issues

…ached` error for capacity overflow handling.
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.

Optimize try_reserve by implementing TODO (remove redundant overflow check)

1 participant