Skip to content

Conversation

dota17
Copy link
Member

@dota17 dota17 commented Nov 15, 2019

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.003%) to 92.128% when pulling bc46b78 on dota17:parseFromStream into f200239 on open-source-parsers:master.

@cdunn2001
Copy link
Contributor

I don't see one way as clearly better than the other. Which is more efficient? In runtime or memory?

@BillyDonahue
Copy link
Contributor

Getline is worse. It reads the file scanning for a character and rdbuf just copies blocks at a time.
of course this is irrelevant if the getline idea doesn't work. And I don't think it works.

What's happening is that the EOF happens to be an int -1, casting it to a char yields -1 or 255 depending on whether char is signed, and we just luck out in that that bit pattern doesn't appear in the files we read with this function, so we get the whole file. But it happens to work I guess. But it's far from semantically correct. We should just close this.

@dota17 dota17 deleted the parseFromStream branch April 28, 2020 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants