Skip to content

Optimize a mark-restoring condition after document reload

Igor Kushnir requested to merge work/optimize-mark-restoring-condition into master

The loop that restores marks compares the index of a temporary mark z to the number of lines in the document lines. The check virtually always succeeds and makes no sense. Compare the temporary mark's line number to the number of lines instead. When the temporary mark's line number is out of the document range, setMark() does nothing, so this commit is only an optimization.

NOTE: Sorry, I haven't tested this optimization, because it seems trivial enough and I am reluctant to spend time patching and building KTextEditor locally.

Merge request reports