3 ms·
Lines 19 and 27 in the source: https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/2019/07/26/readlines.java#L27 https://github.com/lemire/C
by ricardobeat 7y ago
Lines 19 and 27 in the source: https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/2019/07/26/readlines.java#L27 https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/...
- paulddraper 7y agoWhat the heck? You're right, the hidden scanFile()...makes no sense. It's stripping all the new lines from the input. Why? What is going on?
- elFarto 7y agoHe's using it to read the entire files contents into memory, and re-running the lines() method from the now in-memory buffer, presumably to remove any disk I/O from bottle necking the lines() function. Not the best method to use, probably better to use the Files.readString method.