From 488c2ebfff179a35975bf3e08b49b0dd9c75d725 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 18 Nov 2024 23:05:25 +0200 Subject: [PATCH] v.debug: elminate another `import math` that just used the min/max functions --- vlib/v/debug/debug.v | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vlib/v/debug/debug.v b/vlib/v/debug/debug.v index 262fa2c992..60487ac265 100644 --- a/vlib/v/debug/debug.v +++ b/vlib/v/debug/debug.v @@ -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}') }