We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9df8c3e commit fe50948Copy full SHA for fe50948
zlib_wrapper.cpp
@@ -31,7 +31,9 @@ igzfstream&
31
getline(igzfstream &in, string &line) {
32
if (gzgets(in.fileobj, &in.buf[0], in.chunk_size)) {
33
auto eol = std::find(begin(in.buf), end(in.buf), '\n');
34
- line = string(begin(in.buf), eol);
+ line.clear();
35
+ // in case line already has a reserve
36
+ copy(begin(in.buf), eol, std::back_inserter(line));
37
}
38
return in;
39
0 commit comments