]> git.refcnt.org Git - colorize.git/commit
Optimize merging for partial lines further
authorSteven Schubiger <stsc@refcnt.org>
Fri, 15 Jan 2016 14:40:32 +0000 (15:40 +0100)
committerSteven Schubiger <stsc@refcnt.org>
Fri, 15 Jan 2016 14:40:32 +0000 (15:40 +0100)
commit025bf75f863750d29f7c7b523c2ad92f5bb62832
tree5259d7c2181f63c49d64f8a02efb5ca1a330f6bb
parentdbbbe0626872bd88a0262a8545b81a1b5eeceaa4
Optimize merging for partial lines further

Completing partial lines (i.e., to ones without truncated escape sequences)
can be handled more efficiently by concatenating only the partial line
beginning at the last escape control character with the characters read
from the input stream.  Compared to previous code which concatenated the
*entire* partial line with the characters read, pass now the resulting
string of aforementioned concatenation separately to the escape sequence
cleaning function.

Even though it may appear as a minor optimisation, it is a /substantial/
improvement in terms of memory being allocated when cleaning lines.
colorize.c