slightly better syntax (NOTE: 4000 seems arbitrary here)
This commit is contained in:
parent
1080d92a79
commit
4f5bdf82c1
1 changed files with 2 additions and 1 deletions
|
@ -141,7 +141,8 @@ std::tuple<char,bool> autodect_newline(T & stream, std::size_t file_length)
|
||||||
// autodetect newlines
|
// autodetect newlines
|
||||||
char newline = '\n';
|
char newline = '\n';
|
||||||
bool has_newline = false;
|
bool has_newline = false;
|
||||||
for (std::size_t lidx = 0; lidx < file_length && lidx < 4000; ++lidx)
|
std::size_t size = std::min(file_length, 4000UL);
|
||||||
|
for (std::size_t lidx = 0; lidx < size; ++lidx)
|
||||||
{
|
{
|
||||||
char c = static_cast<char>(stream.get());
|
char c = static_cast<char>(stream.get());
|
||||||
if (c == '\r')
|
if (c == '\r')
|
||||||
|
|
Loading…
Reference in a new issue