Pull line length out into its own variable.

This commit is contained in:
joshaber
2016-03-14 13:42:05 -04:00
parent 2a2e22a759
commit d1c8fff86c

View File

@@ -115,8 +115,9 @@ class BufferedProcess
buffered += data
lastNewlineIndex = data.lastIndexOf('\n')
if lastNewlineIndex isnt -1
onLines(buffered.substring(0, lastNewlineIndex + bufferedLength + 1))
buffered = buffered.substring(lastNewlineIndex + bufferedLength + 1)
lineLength = lastNewlineIndex + bufferedLength + 1
onLines(buffered.substring(0, lineLength))
buffered = buffered.substring(lineLength)
stream.on 'close', =>
return if @killed