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

Function first_line_not_before

crates/vm/src/builtins/frame.rs:415–423  ·  view source on GitHub ↗

Find the first line number >= `line` that has code.

(lines: &[i32], line: i32)

Source from the content-addressed store, hash-verified

413
414 /// Find the first line number >= `line` that has code.
415 pub fn first_line_not_before(lines: &[i32], line: i32) -> i32 {
416 let mut result = i32::MAX;
417 for &l in lines {
418 if l >= line && l < result {
419 result = l;
420 }
421 }
422 if result == i32::MAX { -1 } else { result }
423 }
424}
425
426pub fn init(context: &'static Context) {

Callers 1

set_f_linenoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected