db/PadManager: early return, no functional changes

pull/3478/head
muxator 2018-08-29 01:46:18 +02:00
parent 12f224ae72
commit ecb0c41d29
1 changed files with 17 additions and 18 deletions

View File

@ -205,30 +205,29 @@ exports.sanitizePadId = function(padId, callback) {
if(transform_index >= padIdTransforms.length)
{
callback(padId);
return;
}
//check if padId exists
else
exports.doesPadExists(padId, function(junk, exists)
{
exports.doesPadExists(padId, function(junk, exists)
if(exists)
{
if(exists)
callback(padId);
}
else
{
//get the next transformation *that's different*
var transformedPadId = padId;
while(transformedPadId == padId && transform_index < padIdTransforms.length)
{
callback(padId);
transformedPadId = padId.replace(padIdTransforms[transform_index][0], padIdTransforms[transform_index][1]);
transform_index += 1;
}
else
{
//get the next transformation *that's different*
var transformedPadId = padId;
while(transformedPadId == padId && transform_index < padIdTransforms.length)
{
transformedPadId = padId.replace(padIdTransforms[transform_index][0], padIdTransforms[transform_index][1]);
transform_index += 1;
}
//check the next transform
exports.sanitizePadId(transformedPadId, callback, transform_index);
}
});
}
//check the next transform
exports.sanitizePadId(transformedPadId, callback, transform_index);
}
});
}
exports.isValidPadId = function(padId)