about summary refs log tree commit diff stats
path: root/src/local
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-12-01 22:28:43 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-01 22:28:43 +0100
commit32fc2fb35be469119b1c99959f688f0ad5e2f710 (patch)
tree6fde8febcdb1b04c4684135511fcea9ceec71d5e /src/local
parent803986e2ede5619c662017a4c2e54462e0aa3512 (diff)
downloadchawan-32fc2fb35be469119b1c99959f688f0ad5e2f710.tar.gz
pager: small optimization in drawBuffer
Diffstat (limited to 'src/local')
-rw-r--r--src/local/pager.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/local/pager.nim b/src/local/pager.nim
index 5f345a3a..005fefa5 100644
--- a/src/local/pager.nim
+++ b/src/local/pager.nim
@@ -330,12 +330,12 @@ proc drawBuffer*(pager: Pager, container: Container, ostream: Stream) =
       var i = 0
       var s = ""
       for f in line.formats:
-        var outstr = ""
+        let si = i
         while x < f.pos:
           var r: Rune
           fastRuneAt(line.str, i, r)
-          outstr &= r
           x += r.width()
+        let outstr = line.str.substr(si, i - 1)
         s &= pager.term.processOutputString(outstr, w)
         s &= pager.term.processFormat(format, f.format)
       if i < line.str.len: