Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Refactor forkedstoragetrie.js, improve findPath callback in keyExists (
Browse files Browse the repository at this point in the history
…#378)

Clarifies the callback by removing the if statement while retaining the same logical result.
  • Loading branch information
nicholasjpaterno authored and davidmurdoch committed Mar 21, 2019
1 parent 27bf5b8 commit d9f5e68
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/utils/forkedstoragetrie.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};
Expand Down

0 comments on commit d9f5e68

Please sign in to comment.