@@ -350,8 +350,7 @@ Object.defineProperty(Zlib.prototype, 'bytesRead', {
350
350
// `params()` function should not happen while a write is currently in progress
351
351
// on the threadpool.
352
352
function paramsAfterFlushCallback ( level , strategy , callback ) {
353
- if ( ! this . _handle )
354
- assert ( false , 'zlib binding closed' ) ;
353
+ assert ( this . _handle , 'zlib binding closed' ) ;
355
354
this . _handle . params ( level , strategy ) ;
356
355
if ( ! this . _hadError ) {
357
356
this . _level = level ;
@@ -507,8 +506,8 @@ function processChunkSync(self, chunk, flushFlag) {
507
506
else
508
507
buffers . push ( out ) ;
509
508
nread += out . byteLength ;
510
- } else if ( have < 0 ) {
511
- assert ( false , 'have should not go down' ) ;
509
+ } else {
510
+ assert ( have === 0 , 'have should not go down' ) ;
512
511
}
513
512
514
513
// exhausted the output buffer, or used all the input create a new one.
@@ -545,8 +544,7 @@ function processChunkSync(self, chunk, flushFlag) {
545
544
546
545
function processChunk ( self , chunk , flushFlag , cb ) {
547
546
var handle = self . _handle ;
548
- if ( ! handle )
549
- assert ( false , 'zlib binding closed' ) ;
547
+ assert ( handle , 'zlib binding closed' ) ;
550
548
551
549
handle . buffer = chunk ;
552
550
handle . cb = cb ;
@@ -593,8 +591,8 @@ function processCallback() {
593
591
var out = self . _outBuffer . slice ( self . _outOffset , self . _outOffset + have ) ;
594
592
self . _outOffset += have ;
595
593
self . push ( out ) ;
596
- } else if ( have < 0 ) {
597
- assert ( false , 'have should not go down' ) ;
594
+ } else {
595
+ assert ( have === 0 , 'have should not go down' ) ;
598
596
}
599
597
600
598
if ( self . destroyed ) {
0 commit comments