From 39f271bfed7865f273174aabb0ec1ee2d101839d Mon Sep 17 00:00:00 2001 From: muxator Date: Tue, 24 Mar 2020 23:26:19 +0100 Subject: [PATCH] DB.js: remove else clause, since we are already exiting early No functional changes. --- src/node/db/DB.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/node/db/DB.js b/src/node/db/DB.js index 573563665..4150743de 100644 --- a/src/node/db/DB.js +++ b/src/node/db/DB.js @@ -45,29 +45,29 @@ exports.init = function() { console.error("ERROR: Problem while initalizing the database"); console.error(err.stack ? err.stack : err); process.exit(1); - } else { - // everything ok, set up Promise-based methods - ['get', 'set', 'findKeys', 'getSub', 'setSub', 'remove', 'doShutdown'].forEach(fn => { - exports[fn] = util.promisify(db[fn].bind(db)); - }); - - // set up wrappers for get and getSub that can't return "undefined" - let get = exports.get; - exports.get = async function(key) { - let result = await get(key); - return (result === undefined) ? null : result; - }; - - let getSub = exports.getSub; - exports.getSub = async function(key, sub) { - let result = await getSub(key, sub); - return (result === undefined) ? null : result; - }; - - // exposed for those callers that need the underlying raw API - exports.db = db; - resolve(); } + + // everything ok, set up Promise-based methods + ['get', 'set', 'findKeys', 'getSub', 'setSub', 'remove', 'doShutdown'].forEach(fn => { + exports[fn] = util.promisify(db[fn].bind(db)); + }); + + // set up wrappers for get and getSub that can't return "undefined" + let get = exports.get; + exports.get = async function(key) { + let result = await get(key); + return (result === undefined) ? null : result; + }; + + let getSub = exports.getSub; + exports.getSub = async function(key, sub) { + let result = await getSub(key, sub); + return (result === undefined) ? null : result; + }; + + // exposed for those callers that need the underlying raw API + exports.db = db; + resolve(); }); }); }