From c61942c3c93310350217dcd64229c37347b12738 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Tue, 12 Mar 2019 21:10:12 -0400 Subject: [PATCH] Refactor forkedstoragetrie.js, improve findPath callback in keyExists --- 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); }); };