db/Pad: reversed condition to make core logic evident. No functional changes

Here it was legal to replace a lax comparison with a strict one, since we are
using indexOf(), whose return value is known.
This commit is contained in:
muxator 2018-08-29 02:52:26 +02:00
parent d931a700b4
commit 69e1bf28aa

View file

@ -620,9 +620,14 @@ Pad.prototype.remove = function remove(callback) {
//is it a group pad? -> delete the entry of this pad in the group //is it a group pad? -> delete the entry of this pad in the group
function(callback) function(callback)
{ {
//is it a group pad? if(padID.indexOf("$") === -1)
if(padID.indexOf("$")!=-1)
{ {
// it isn't a group pad, nothing to do here
callback();
return;
}
// it is a group pad
var groupID = padID.substring(0,padID.indexOf("$")); var groupID = padID.substring(0,padID.indexOf("$"));
db.get("group:" + groupID, function (err, group) db.get("group:" + groupID, function (err, group)
@ -637,12 +642,6 @@ Pad.prototype.remove = function remove(callback) {
callback(); callback();
}); });
}
//its no group pad, nothing to do here
else
{
callback();
}
}, },
//remove the readonly entries //remove the readonly entries
function(callback) function(callback)