Skip to content

Commit

Permalink
Refactor on equality check function (#1280)
Browse files Browse the repository at this point in the history
Avoidable 'if' statement
  • Loading branch information
dvdalilue committed Jul 13, 2021
1 parent b5b0ac1 commit a41f338
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lib/mixins/attachments.js
Expand Up @@ -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
);
}

0 comments on commit a41f338

Please sign in to comment.