small_slice_eq

Function small_slice_eq 

Source
unsafe fn small_slice_eq(x: &[u8], y: &[u8]) -> bool
🔬This is a nightly-only experimental API. (pattern #27721)
Available on x86-64 and target feature sse2, or LoongArch LA64 and target feature lsx only.
Expand description

Compares short slices for equality.

It avoids a call to libc’s memcmp which is faster on long slices due to SIMD optimizations but it incurs a function call overhead.

§Safety

Both slices must have the same length.