Skip to content

Fix unicode tables #5945

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

Merged
merged 2 commits into from
Apr 20, 2013
Merged

Fix unicode tables #5945

merged 2 commits into from
Apr 20, 2013

Conversation

graydon
Copy link
Contributor

@graydon graydon commented Apr 18, 2013

This switches the unicode functions in core to use static character-range tables and a binary search helper rather than open-coded switch statements. It adds about 50k of read only data to the libcore binary but cuts out a similar amount of compiled IR. Would have done it this way in the first place but we didn't have structured statics for a long time.

* Returns the index where the comparator returned `Equal`, or `None` if
* not found.
*/
pub fn bsearch<T>(v: &[T], f: &fn(&T) -> Ordering) -> Option<uint> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Haskell this is called bsearch_by and the other is called bsearch. Should we follow that convention?

bors added a commit that referenced this pull request Apr 20, 2013
This switches the unicode functions in core to use static character-range tables and a binary search helper rather than open-coded switch statements. It adds about 50k of read only data to the libcore binary but cuts out a similar amount of compiled IR. Would have done it this way in the first place but we didn't have structured statics for a long time.
@bors bors closed this Apr 20, 2013
@bors bors merged commit 5a3d26f into rust-lang:incoming Apr 20, 2013
@kud1ing
Copy link

kud1ing commented Apr 22, 2013

@graydon, do you think it would be a good idea to write an additional line // Generated by "etc/unicode.py"?

@graydon
Copy link
Contributor Author

graydon commented Apr 22, 2013

Oh, probably, yeah.

@graydon graydon deleted the fix-unicode-tables branch April 25, 2013 15:27
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 9, 2020
…ion_in_needless_range_loop, r=flip1995

Don't emit a lint for the suggestion leading to errors in `needless_range_loop`

Fix rust-lang#5945

changelog: Don't emit a lint for the suggestion leading to errors in `needless_range_loop`
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.

4 participants