소스 검색

Compiles down to `xor` and `cmp` instead of `add` and `cmp`

IVogel 2 년 전
부모
커밋
64228785a9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/lua_struct.rs

+ 1 - 1
src/lua_struct.rs

@@ -37,7 +37,7 @@ struct ReaderState<'a> {
 }
 
 fn is_digit(byte: u8) -> bool {
-    byte >= b'0' && byte <= b'9'
+    byte ^ b'0' < 10
 }
 
 unsafe fn read_number(state: &mut ReaderState) -> Option<usize> {