From a41f33886f36f35cdcf048760e455a6338f30f1c Mon Sep 17 00:00:00 2001 From: David Lilue <2525462+dvdalilue@users.noreply.github.com> Date: Tue, 13 Jul 2021 23:52:41 +0200 Subject: [PATCH] Refactor on equality check function (#1280) Avoidable 'if' statement --- lib/mixins/attachments.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/mixins/attachments.js b/lib/mixins/attachments.js index 7cf2fe3e..ef245d3d 100644 --- a/lib/mixins/attachments.js +++ b/lib/mixins/attachments.js @@ -105,14 +105,11 @@ export default { /** check two embedded file metadata objects for equality */ function isEqual(a, b) { - if ( - a.Subtype !== b.Subtype || - a.Params.CheckSum.toString() !== b.Params.CheckSum.toString() || - a.Params.Size !== b.Params.Size || - a.Params.CreationDate !== b.Params.CreationDate || - a.Params.ModDate !== b.Params.ModDate - ) { - return false; - } - return true; + return ( + a.Subtype === b.Subtype && + a.Params.CheckSum.toString() === b.Params.CheckSum.toString() && + a.Params.Size === b.Params.Size && + a.Params.CreationDate === b.Params.CreationDate && + a.Params.ModDate === b.Params.ModDate + ); }