db/PadManager: early return, no functional changes
This commit is contained in:
parent
391bd79e03
commit
12f224ae72
1 changed files with 12 additions and 13 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue