From 75d1b3834c6de41408b69e06c393e15f3bed3d98 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 15 Jul 2021 12:16:03 +1000 Subject: [PATCH] Simplify expression --- src/lib/waku_message/version_1.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/lib/waku_message/version_1.ts b/src/lib/waku_message/version_1.ts index 19ae218ad0..ca681579ef 100644 --- a/src/lib/waku_message/version_1.ts +++ b/src/lib/waku_message/version_1.ts @@ -222,14 +222,9 @@ function validateDataIntegrity( return false; } - if ( - expectedSize > 3 && - Buffer.from(value).equals(Buffer.alloc(value.length)) - ) { - return false; - } - - return true; + return !( + expectedSize > 3 && Buffer.from(value).equals(Buffer.alloc(value.length)) + ); } function getSignature(message: Buffer): Buffer {