Find the first line number >= `line` that has code.
(lines: &[i32], line: i32)
| 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 | |
| 426 | pub fn init(context: &'static Context) { |