Explorar o código

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

IVogel %!s(int64=2) %!d(string=hai) anos
pai
achega
64228785a9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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> {