MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / slice_shift

Function slice_shift

cranelift/bforest/src/lib.rs:124–128  ·  view source on GitHub ↗

Shift elements in `s` to the left by `n` positions.

(s: &mut [T], n: usize)

Source from the content-addressed store, hash-verified

122
123/// Shift elements in `s` to the left by `n` positions.
124fn slice_shift<T: Copy>(s: &mut [T], n: usize) {
125 for j in 0..s.len() - n {
126 s[j] = s[j + n];
127 }
128}
129
130#[cfg(test)]
131mod tests {

Callers 5

slice_shiftingFunction · 0.85
balance_nodesMethod · 0.85
inner_removeMethod · 0.85
leaf_removeMethod · 0.85
balanceMethod · 0.85

Calls 1

lenMethod · 0.45

Tested by 1

slice_shiftingFunction · 0.68