-
Notifications
You must be signed in to change notification settings - Fork 2
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
Elide bounds checks #10
base: master
Are you sure you want to change the base?
Conversation
Sounds good. It seems the nearby if statements should also be updated to this style. The nearby panic around line 353 should become The same change should be made on ct_slice_eq as well. This would change a failing condition to a panicing condition so the docs/comment would have to updated to reflect it. If you can make those two changes I'll accept and update the docs. |
No, that completely misses the point of this change. The reason for However, LLVM can't do that for The trick works due to the fact that slices in Rust are actually a pair of variables: a pointer to the first element, and the length. What the Of course, that introduces another bounds check for Now consider what would happen if I added a
We still need the test for
Same as above: it's better to keep the test as-is. |
Ah okay. Thank you for explaining a bit better. Accepted |
No description provided.