-
Notifications
You must be signed in to change notification settings - Fork 13.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
LinearMap.len is wrong #4277
Comments
Looking at the code, it should return the number of entries contained in the map. It definitely doesn't return the capacity but maybe does something wrong while tracking the entry count. |
Looked at the code myself. Wasn't clear at first what's going on, but after looking at it more closely expand seems wrong: each time through it's going to increment size by the old capacity. |
Yeah, you're right. This needs to reset self.size to zero before copying the old entries to their new buckets. |
Fixed. |
…mparison, r=flip1995 Add lint for float in array comparison Fixes rust-lang#4277 changelog: - Added new handler for expression of index kind (e.g. `arr[i]`). It returns a constant when both array and index are constant, or when the array is constant and all values are equal. - Trigger float_cmp and float_cmp_const lint when comparing arrays. Allow for comparison when one of the arrays contains only zeros or infinities. - Added appropriate tests for such cases.
This does not return the number of entries in the map. I'm guessing that it instead returns capacity.
The text was updated successfully, but these errors were encountered: