Bug 662164 - Use fast iteration in nsFilePicker.mm. r=joshmoz

This commit is contained in:
Mounir Lamouri 2011-06-09 11:28:16 +02:00
Родитель efba1d162d
Коммит 3413b05e86
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -402,12 +402,9 @@ nsFilePicker::GetLocalFiles(const nsString& inTitle, PRBool inAllowMultiple, nsC
// Converts data from a NSArray of NSURL to the returned format.
// We should be careful to not call [thePanel URLs] more than once given that
// it creates a new array each time.
// TODO: we should use Fast Enumeration as soon as Obj-C 2.0 is allowed in
// our code.
NSArray* urls = [thePanel URLs];
for (unsigned int i = 0; i < [urls count]; ++i) {
NSURL* url = [urls objectAtIndex:i];
// We are using Fast Enumeration, thus the NSURL array is created once then
// iterated.
for (NSURL* url in [thePanel URLs]) {
if (!url) {
continue;
}