-
Notifications
You must be signed in to change notification settings - Fork 183
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
Remove the zero index from VarZeroVec #5601
Remove the zero index from VarZeroVec #5601
Conversation
f06ff0e
to
43aec09
Compare
I still need to run all the datagens and fix non- |
789202f
to
220b65f
Compare
It was there to enable us to use |
Yeah, that would require far more changes to the unsafe code of VZV than just METADATA_WIDTH, METADATA_WIDTH didn't particularly set the stage for anythig there code-wise. It would be interesting encapsulating more and more of the format into the trait to allow for fancier custom formats. |
220b65f
to
46c16c4
Compare
d7b6c62
to
1f66a65
Compare
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.
To components.rs
// Safety: mid is < end <= len, so in-range | ||
let cmp = predicate(self.get_unchecked(mid)); | ||
|
||
match cmp { |
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.
Question: why did you expand the binary_search impl instead of using the std one?
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.
The hacky impl was written assuming a slice to search on. Now I could still use a byte slice that I have cut out appropriately, but the indices slice that we currently use is no longer long enough for this to work, and it was going to get more complicated, so I decided to dispense with the weird hack. I can bring it back and make it work with the weird hack if desired.
Fixes #5603 v3 isn't yet necessary but will become necessary with #5601. This can be landed independently of #5601 but these PRs will bitrot each other. Slight preference to landing this first. (At the moment, V2 == V3, but #5601 breaks the format) This makes V1 and V2 data still *detectable* by ICU4X, but they will throw a helpful error when attempting to load them. From a user's POV, there is now only the "blob" format (which covers both V003 and V003Bigger, picked at datagen time based on data size. <!-- Thank you for your pull request to ICU4X! Reminder: try to use [Conventional Comments](https://conventionalcomments.org/) to make comments clearer. Please see https://github.com/unicode-org/icu4x/blob/main/CONTRIBUTING.md for general information on contributing to ICU4X. -->
f00a1d8
to
74c0048
Compare
bc43449
to
94f05ab
Compare
let indices_bytes = slice.get_unchecked(..F::Index::SIZE * (len_minus_one as usize)); | ||
let things = slice.get_unchecked(F::Index::SIZE * (len_minus_one as usize)..); |
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.
Thought: you should use split_at_unchecked
here, but I think it isn't MSRV yet
94f05ab
to
1cc0814
Compare
Caused by clash of #5620 and #5601 <!-- Thank you for your pull request to ICU4X! Reminder: try to use [Conventional Comments](https://conventionalcomments.org/) to make comments clearer. Please see https://github.com/unicode-org/icu4x/blob/main/CONTRIBUTING.md for general information on contributing to ICU4X. -->
Fixes #5516
Also removes
METADATA_WIDTH
, we've set it to 0 and aren't using it. It's an unnecessary untested complication on our unsafe code.