@@ -445,32 +445,31 @@ class ZCtx : public AsyncWrap, public ThreadPoolWork {
445
445
// But on the decompression side, a value of 0 for windowBits tells zlib
446
446
// to use the window size in the zlib header of the compressed stream.
447
447
uint32_t windowBits;
448
- bool winCheck = args[0 ]->Uint32Value (context).To (&windowBits);
448
+ if (! args[0 ]->Uint32Value (context).To (&windowBits)) return ;
449
449
450
450
if (!((windowBits == 0 ) &&
451
451
(ctx->mode_ == INFLATE ||
452
452
ctx->mode_ == GUNZIP ||
453
453
ctx->mode_ == UNZIP))) {
454
- CHECK ((windowBits >= Z_MIN_WINDOWBITS && windowBits <= Z_MAX_WINDOWBITS &&
455
- winCheck ) &&
456
- " invalid windowBits" );
454
+ CHECK (
455
+ (windowBits >= Z_MIN_WINDOWBITS && windowBits <= Z_MAX_WINDOWBITS ) &&
456
+ " invalid windowBits" );
457
457
}
458
458
459
459
int level = args[1 ]->Int32Value ();
460
460
CHECK ((level >= Z_MIN_LEVEL && level <= Z_MAX_LEVEL) &&
461
461
" invalid compression level" );
462
462
463
463
uint32_t memLevel;
464
- bool memCheck = args[2 ]->Uint32Value (context).To (&memLevel);
465
- CHECK ((memLevel >= Z_MIN_MEMLEVEL && memLevel <= Z_MAX_MEMLEVEL &&
466
- memCheck) &&
464
+ if (!args[2 ]->Uint32Value (context).To (&memLevel)) return ;
465
+ CHECK ((memLevel >= Z_MIN_MEMLEVEL && memLevel <= Z_MAX_MEMLEVEL) &&
467
466
" invalid memlevel" );
468
467
469
468
uint32_t strategy;
470
- bool strategyCheck = args[3 ]->Uint32Value (context).To (&strategy);
469
+ if (! args[3 ]->Uint32Value (context).To (&strategy)) return ;
471
470
CHECK ((strategy == Z_FILTERED || strategy == Z_HUFFMAN_ONLY ||
472
471
strategy == Z_RLE || strategy == Z_FIXED ||
473
- strategy == Z_DEFAULT_STRATEGY && strategyCheck ) &&
472
+ strategy == Z_DEFAULT_STRATEGY) &&
474
473
" invalid strategy" );
475
474
476
475
CHECK (args[4 ]->IsUint32Array ());
0 commit comments