From d9f5e68f7b982af796550e0f16450964fecd0e3b Mon Sep 17 00:00:00 2001 From: Nick Paterno <43416138+nicholasjpaterno@users.noreply.github.com> Date: Thu, 21 Mar 2019 13:39:29 -0600 Subject: [PATCH] Refactor forkedstoragetrie.js, improve findPath callback in keyExists (#378) Clarifies the callback by removing the if statement while retaining the same logical result. --- lib/utils/forkedstoragetrie.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/utils/forkedstoragetrie.js b/lib/utils/forkedstoragetrie.js index 98c40e4aea..775dbe5119 100644 --- a/lib/utils/forkedstoragetrie.js +++ b/lib/utils/forkedstoragetrie.js @@ -26,10 +26,7 @@ ForkedStorageTrie.prototype.keyExists = function(key, callback) { key = utils.toBuffer(key); this.findPath(key, function(err, node, remainder, stack) { - var exists = false; - if (node && remainder.length === 0) { - exists = true; - } + const exists = node && remainder.length === 0; callback(err, exists); }); };