Function core::str::pattern::small_slice_eq

source ·
unsafe fn small_slice_eq(x: &[u8], y: &[u8]) -> bool
🔬This is a nightly-only experimental API. (pattern #27721)
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.