Skip to content
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

Shrink Unicode tables (even more) #70486

Merged
merged 14 commits into from
Mar 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a right shift mapping
This saves less bytes - by far - and is likely not the best operator to choose.
But for now, it works -- a better choice may arise later.

Alphabetic     : 2538 bytes   (- 84 bytes)
Case_Ignorable : 1773 bytes   (- 30 bytes)
Cased          : 790 bytes    (- 18 bytes)
Cc             : 26 bytes     (-  6 bytes)
Grapheme_Extend: 1490 bytes   (- 18 bytes)
Lowercase      : 865 bytes    (- 36 bytes)
N              : 1040 bytes   (- 24 bytes)
Uppercase      : 778 bytes    (- 60 bytes)
White_Space    : 85 bytes     (-  6 bytes)
Total table sizes: 9385 bytes (-282 bytes)
Mark-Simulacrum committed Mar 21, 2020
commit 7b29b70d6ea52e9324f9328bed9beb6cf516c1ce
4 changes: 2 additions & 2 deletions src/libcore/unicode/mod.rs
Original file line number Diff line number Diff line change
@@ -66,12 +66,12 @@ fn range_search<
} else {
let (real_idx, mapping) = bitset_canonicalized[idx - CANONICAL];
let mut word = bitset_canonical[real_idx as usize];
let should_invert = mapping & (1 << 7) != 0;
let should_invert = mapping & (1 << 6) != 0;
if should_invert {
word = !word;
}
// Unset the inversion bit
let rotate_by = mapping & !(1 << 7);
let rotate_by = mapping & !(1 << 6);
word = word.rotate_left(rotate_by as u32);
word
};
Loading