db/PadManager: early return, no functional changes

pull/3478/head
muxator 2018-08-29 01:47:38 +02:00
parent ecb0c41d29
commit 4728736dd8
1 changed files with 9 additions and 10 deletions

View File

@ -214,19 +214,18 @@ exports.sanitizePadId = function(padId, callback) {
if(exists)
{
callback(padId);
return;
}
else
//get the next transformation *that's different*
var transformedPadId = padId;
while(transformedPadId == padId && transform_index < padIdTransforms.length)
{
//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);
transformedPadId = padId.replace(padIdTransforms[transform_index][0], padIdTransforms[transform_index][1]);
transform_index += 1;
}
//check the next transform
exports.sanitizePadId(transformedPadId, callback, transform_index);
});
}