From 41c85661efd10e2c16b2dd9a94ddc8f7e8ef1667 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 26 Oct 2022 22:45:58 +0300 Subject: [PATCH] fix quadratic execution of `VAUTOFIX=1 v check-md .` when a long .md file has many examples, that have to be corrected. --- cmd/tools/vcheck-md.v | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/tools/vcheck-md.v b/cmd/tools/vcheck-md.v index 2fce788317..0227bf9b86 100644 --- a/cmd/tools/vcheck-md.v +++ b/cmd/tools/vcheck-md.v @@ -645,6 +645,7 @@ fn (mut f MDFile) autofix_example(e VCodeExample, vfile string) ! { new_lines << f.lines#[e.eline..] f.update_examples(new_lines)! os.rm(vfile) or {} + f.examples = f.examples.filter(it.sline >= e.sline) return ExampleWasRewritten{} }