forked from pkrumins/node-lazy
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pkrumins#11: .lines bug creating "0"s from empty lines
Empty lines (lines ending with newline immediately) were generating bogus "0"s as discussed in pkrumins#11. The problem was caused by a careless use of + in `mergeBuffers`, which resulted in creating a Buffer with string "0" instead of an empty one with length 0 when an empty buffer was among the ones being merged. mergeBuffers also had an undefined case for empty set of input buffers, which has been fixed to always return a buffer with length 0. This also makes the .lines getter code more readable by using a better variable name and eliminating tabs from white space.
- Loading branch information
Showing
1 changed file
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters