mirror of
https://github.com/vlang/v.git
synced 2025-09-13 17:36:52 -04:00
v.debug: elminate another import math
that just used the min/max functions
This commit is contained in:
parent
2ba1271a2e
commit
488c2ebfff
@ -4,7 +4,6 @@
|
||||
module debug
|
||||
|
||||
import os
|
||||
import math
|
||||
import readline
|
||||
import strings
|
||||
import term
|
||||
@ -156,8 +155,8 @@ fn (mut d Debugger) parse_input(input string, is_ctrl bool) (string, string) {
|
||||
fn (mut d Debugger) print_context_lines(path string, line int, lines int) ! {
|
||||
file_content := os.read_file(path)!
|
||||
chunks := file_content.split('\n')
|
||||
offset := math.max(line - lines, 1)
|
||||
for n, s in chunks[offset - 1..math.min(chunks.len, line + lines)] {
|
||||
offset := int_max(line - lines, 1)
|
||||
for n, s in chunks[offset - 1..int_min(chunks.len, line + lines)] {
|
||||
ind := if n + offset == line { '>' } else { ' ' }
|
||||
flush_println('${n + offset:04}${ind} ${s}')
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user