]> git.saurik.com Git - apt.git/commit
implement a buffer system for FileFd::ReadLine
authorDavid Kalnischkies <david@kalnischkies.de>
Wed, 23 Dec 2015 15:42:12 +0000 (16:42 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 23 Dec 2015 15:42:12 +0000 (16:42 +0100)
commitf63123c385738b059cd854b694a0f62558fb8cbe
tree735022972359476a575b8d2e40937da6504b62ba
parent7a68effcb904b4424b54a30e448b6f2560cd1078
implement a buffer system for FileFd::ReadLine

The default implementation of ReadLine was very naive by just reading
each character one-by-one. That is kinda okay for libraries implementing
compression as they have internal buffers (but still not great), but
while working with files directly or via a pipe as there is no buffer
there so all those reads are in fact system calls.

This commit introduces an internal buffer in the FileFd implementation
which is only used by ReadLine. The more low-level Read and all other
actions remain unbuffered – they just changed to deal with potential
"left-overs" in the buffer correctly.

Closes: 808579
apt-pkg/contrib/fileutl.cc