>+ newFolderName.Assign(folderName);
>+ for (uint32_t i=2, containsChild; ; i++) {
>+ rv = ContainsChildNamed(newFolderName, &containsChild);
>+ NS_ENSURE_SUCCESS(rv, rv);
>+ if (!containsChild)
>+ break;
>+ // This could be localizable but Toolkit is fine without it, see
>+ // mozilla/toolkit/content/contentAreaUtils.js::uniqueFile()
>+ newFolderName.Assign(folderName);
>+ newFolderName.AppendLiteral("(");
>+ newFolderName.AppendInt(i);
>+ newFolderName.AppendLiteral(")");
>+ }
Or really type clean:
>+ for (uint32_t i=2; ; i++) {
>+ bool containsChild;
>+ rv = ContainsChildNamed(newFolderName, &containsChild);
...
I'm not sure, if newFolderName and rv also could be drawn into the loop, are they used outside?
Little sophisticated:
>+ newFolderName. Assign( folderName) ; med(newFolderNa me, &containsChild); SUCCESS( rv, rv); toolkit/ content/ contentAreaUtil s.js::uniqueFil e() Assign( folderName) ; AppendLiteral( "("); AppendInt( i); AppendLiteral( ")");
>+ for (uint32_t i=2, containsChild; ; i++) {
>+ rv = ContainsChildNa
>+ NS_ENSURE_
>+ if (!containsChild)
>+ break;
>+ // This could be localizable but Toolkit is fine without it, see
>+ // mozilla/
>+ newFolderName.
>+ newFolderName.
>+ newFolderName.
>+ newFolderName.
>+ }
Or really type clean: med(newFolderNa me, &containsChild);
>+ for (uint32_t i=2; ; i++) {
>+ bool containsChild;
>+ rv = ContainsChildNa
...
I'm not sure, if newFolderName and rv also could be drawn into the loop, are they used outside?