From 12f224ae723ac7ba15531f4778732cd220ee5d9f Mon Sep 17 00:00:00 2001 From: muxator Date: Wed, 29 Aug 2018 01:44:13 +0200 Subject: [PATCH] db/PadManager: early return, no functional changes --- src/node/db/PadManager.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index 2ecd6e274..ae908e5c0 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -159,21 +159,20 @@ exports.getPad = function(id, text, callback) if(pad != null) { callback(null, pad); + return; } - //try to load pad - else - { - pad = new Pad(id); - //initalize the pad - pad.init(text, function(err) - { - if(ERR(err, callback)) return; - globalPads.set(id, pad); - padList.addPad(id); - callback(null, pad); - }); - } + //try to load pad + pad = new Pad(id); + + //initalize the pad + pad.init(text, function(err) + { + if(ERR(err, callback)) return; + globalPads.set(id, pad); + padList.addPad(id); + callback(null, pad); + }); } exports.listAllPads = function(cb)