Преглед изворни кода

Merge pull request #5776 from connnnal/utf8-1-bounds

Disable bounds check for the first utf8 byte
gingerBill пре 4 дана
родитељ
комит
b8fdd91c9f
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      core/unicode/utf8/utf8.odin

+ 1 - 1
core/unicode/utf8/utf8.odin

@@ -109,7 +109,7 @@ decode_rune_in_bytes :: proc "contextless" (s: []u8) -> (rune, int) {
 	if n < 1 {
 		return RUNE_ERROR, 0
 	}
-	s0 := s[0]
+	#no_bounds_check s0 := s[0]
 	x := accept_sizes[s0]
 	if x >= 0xF0 {
 		mask := rune(x) << 31 >> 31 // NOTE(bill): Create 0x0000 or 0xffff.