- $.each(manifest.split('\n'), function(_, line) {
- var i, match, foundName;
- var toks = line.split(' ');
- for (var i=1; i<toks.length && ok; i++)
- if (match = toks[i].match(/^\d+:\d+:(\S+)/))
- if (toks[0] + '/' + match[1] === streamName + '/' + newName) {
- suffixInt = (suffixInt || 0) + 1;
- ok = false;
- }
- });
+ while (ok && null !==
+ (lineMatch = linesRe.exec(manifest))) {
+ // lineMatch is [theEntireLine, streamName]
+ while (ok && null !==
+ (fileTokenMatch = fileTokensRe.exec(lineMatch[0]))) {
+ // fileTokenMatch is [theEntireToken, fileName]
+ if (lineMatch[1] + '/' + fileTokenMatch[1]
+ ===
+ newStreamName + '/' + newName) {
+ ok = false;
+ }
+ }
+ }
+ suffixInt = (suffixInt || 0) + 1;