Simplify MOVE macro

This commit is contained in:
David Tolnay 2022-07-22 22:31:29 -07:00
parent c5de022daa
commit 924ba2d634
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -333,19 +333,7 @@ macro_rules! WIDTH {
macro_rules! MOVE {
($string:expr) => {
$string.pointer = $string.pointer.wrapping_offset(
(if *$string.pointer as libc::c_int & 0x80_i32 == 0_i32 {
1_i32
} else if *$string.pointer as libc::c_int & 0xe0_i32 == 0xc0_i32 {
2_i32
} else if *$string.pointer as libc::c_int & 0xf0_i32 == 0xe0_i32 {
3_i32
} else if *$string.pointer as libc::c_int & 0xf8_i32 == 0xf0_i32 {
4_i32
} else {
0_i32
}) as isize,
)
$string.pointer = $string.pointer.wrapping_offset(WIDTH!($string) as isize)
};
}