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

Method set

crates/sre_engine/src/engine.rs:80–88  ·  view source on GitHub ↗
(&mut self, mark_nr: usize, position: usize)

Source from the content-addressed store, hash-verified

78 }
79
80 fn set(&mut self, mark_nr: usize, position: usize) {
81 if mark_nr & 1 != 0 {
82 self.last_index = mark_nr as isize / 2 + 1;
83 }
84 if mark_nr >= self.marks.len() {
85 self.marks.resize(mark_nr + 1, Optioned::none());
86 }
87 self.marks[mark_nr] = Optioned::some(position);
88 }
89
90 fn push(&mut self) {
91 self.marks_stack.push((self.marks.clone(), self.last_index));

Callers 1

_matchFunction · 0.45

Calls 3

noneFunction · 0.85
lenMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected