mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
db/PadManager: early return, no functional changes
This commit is contained in:
parent
12f224ae72
commit
ecb0c41d29
1 changed files with 17 additions and 18 deletions
|
@ -205,30 +205,29 @@ exports.sanitizePadId = function(padId, callback) {
|
||||||
if(transform_index >= padIdTransforms.length)
|
if(transform_index >= padIdTransforms.length)
|
||||||
{
|
{
|
||||||
callback(padId);
|
callback(padId);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if padId exists
|
//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
|
//check the next transform
|
||||||
{
|
exports.sanitizePadId(transformedPadId, callback, transform_index);
|
||||||
//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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.isValidPadId = function(padId)
|
exports.isValidPadId = function(padId)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue