dudleycarr/nsqjs — pull request #19 by ohwillie (2014-02-17 23:21:02+00:00)
Title: Simplify FrameBuffer.

* Use _.compact when building the list of buffers in #consume.
* Use the @buffer instance variable instead of passing it around.
* Inline dataSize into frameSize as it wasn't providing clarity.
* Inline unpackFrame into pluckFrame as it wasn't providing clarity.
* Remove the if/then from nextFrameOffset, rename it to frameOffset, reuse
frameOffset, and have the initial offset extraction while loop handle bounds
checking.
* Use _.initial and _.map when getting all but the last frame as they're
chainable and the intent of _.initial is a bit clearer.
* Use delete when losing the reference to @buffer instead of setting it to null.
* Remove unnecessary parentheses.