Skip to content

Slight perf improvement on char::to_ascii_lowercase #81837

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 5 commits into from
Feb 23, 2021
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
Move const def nearer usage.
gilescope committed Feb 14, 2021

Unverified

This user has not yet uploaded their public signing key.
commit 33d8b0456876181883f8d97997a3a0a6e9ff652f
6 changes: 3 additions & 3 deletions library/core/src/num/mod.rs
Original file line number Diff line number Diff line change
@@ -6,9 +6,6 @@ use crate::intrinsics;
use crate::mem;
use crate::str::FromStr;

/// If 6th bit set ascii is upper case.
const ASCII_CASE_MASK: u8 = 0b0010_0000;

// Used because the `?` operator is not allowed in a const context.
macro_rules! try_opt {
($e:expr) => {
@@ -155,6 +152,9 @@ impl isize {
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
}

/// If 6th bit set ascii is upper case.
const ASCII_CASE_MASK: u8 = 0b0010_0000;

#[lang = "u8"]
impl u8 {
uint_impl! { u8, u8, 8, 255, 2, "0x82", "0xa", "0x12", "0x12", "0x48", "[0x12]",