Skip to content

Commit

Permalink
refactor(bufferCount): refactored as requested by @jayphelps
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsik committed Feb 15, 2017
1 parent dfd75dd commit 9233ec4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/operator/bufferCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ class BufferSkipCountSubscriber<T> extends Subscriber<T> {
}

protected _next(value: T): void {
const { bufferSize, startBufferEvery, buffers } = this;
const { bufferSize, startBufferEvery, buffers, count } = this;

if (this.count++ % startBufferEvery === 0) {
this.count++;
if (count % startBufferEvery === 0) {
buffers.push([]);
}

Expand Down

0 comments on commit 9233ec4

Please sign in to comment.