MCPcopy Index your code
hub / github.com/RustPython/RustPython / read_fast

Method read_fast

crates/vm/src/stdlib/_io.rs:1204–1208  ·  view source on GitHub ↗
(&mut self, n: usize)

Source from the content-addressed store, hash-verified

1202 }
1203
1204 fn read_fast(&mut self, n: usize) -> Option<Vec<u8>> {
1205 let ret = self.active_read_slice().get(..n)?.to_vec();
1206 self.pos += n as Offset;
1207 Some(ret)
1208 }
1209
1210 fn read_generic(&mut self, n: usize, vm: &VirtualMachine) -> PyResult<Option<Vec<u8>>> {
1211 if let Some(fast) = self.read_fast(n) {

Callers 2

read_genericMethod · 0.80
read1Method · 0.80

Calls 4

to_vecMethod · 0.80
active_read_sliceMethod · 0.80
SomeClass · 0.50
getMethod · 0.45

Tested by

no test coverage detected