MCPcopy Create free account
hub / github.com/digama0/lean-sys / lean_string_utf8_get_fast

Function lean_string_utf8_get_fast

src/string.rs:88–97  ·  view source on GitHub ↗
(s: b_lean_obj_arg, i: b_lean_obj_arg)

Source from the content-addressed store, hash-verified

86
87#[inline(always)]
88pub unsafe fn lean_string_utf8_get_fast(s: b_lean_obj_arg, i: b_lean_obj_arg) -> u32 {
89 let st = lean_string_cstr(s);
90 let idx = lean_unbox(i);
91 let c = *st.add(idx);
92 if c & 0x80 == 0 {
93 c as u32
94 } else {
95 lean_string_utf8_get_fast_cold(st, idx, lean_string_size(s), c)
96 }
97}
98
99#[inline(always)]
100pub unsafe fn lean_string_get_byte_fast(s: b_lean_obj_arg, i: b_lean_obj_arg) -> u8 {

Callers

nothing calls this directly

Calls 3

lean_string_cstrFunction · 0.85
lean_unboxFunction · 0.85
lean_string_sizeFunction · 0.85

Tested by

no test coverage detected