-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix(rust): Fix UnitVec
inline clone and with_capacity
#18586
Conversation
13ea45b
to
9bb7f0d
Compare
9bb7f0d
to
1ae5d74
Compare
CodSpeed Performance ReportMerging #18586 will not alter performanceComparing Summary
|
test |
UnitVec
inline cloneUnitVec
inline clone and with_capacity
crates/polars-utils/src/idx_vec.rs
Outdated
fn realloc(&mut self, new_cap: usize) { | ||
assert!(new_cap >= self.len); | ||
assert!(new_cap >= self.len.max(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it needs to be bigger than 1, not bigger or equal, I'd just write new_cap => self.len && new_cap > 1
instead of being fancy with max
:). Capacity == 1 is a cursed special value. Doc comment also needs update.
Oh I noticed it should've been |
UnitVec
inline clone and with_capacity
UnitVec
inline clone and with_capacity
No description provided.