зеркало из https://github.com/mozilla/gecko-dev.git
Bug 662164 - Use fast iteration in nsFilePicker.mm. r=joshmoz
This commit is contained in:
Родитель
efba1d162d
Коммит
3413b05e86
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче