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

Method map_index

cranelift/codegen/src/ranges.rs:92–100  ·  view source on GitHub ↗
(&self, index: usize)

Source from the content-addressed store, hash-verified

90 }
91
92 fn map_index(&self, index: usize) -> usize {
93 if self.reverse {
94 // These subtractions can't overflow because callers
95 // enforce that 0 <= index < self.len()
96 self.len() - 1 - index
97 } else {
98 index
99 }
100 }
101
102 /// Update these ranges to reflect that the list they refer to has
103 /// been reversed. Afterwards, the ranges will still be indexed

Callers 2

getMethod · 0.45
iterMethod · 0.45

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected