Ignore:
Timestamp:
Dec 26, 2008, 7:25:17 AM (12 years ago)
Author:
livings124
Message:

eliminate some more enumerator objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PrefsController.m

    r7508 r7514  
    407407    NSArray * directories = [NSArray arrayWithObjects: @"/System/Library/Sounds", @"/Library/Sounds", @"Library/Sounds", nil];
    408408   
    409     BOOL isDirectory;
    410     NSString * directory;
    411     NSEnumerator * enumerator = [directories objectEnumerator];
    412     while ((directory = [enumerator nextObject]))
     409    for (NSString * directory in directories)
     410    {
     411        BOOL isDirectory;
    413412        if ([[NSFileManager defaultManager] fileExistsAtPath: directory isDirectory: &isDirectory] && isDirectory)
    414413        {
    415             NSString * sound;
    416             NSEnumerator * soundEnumerator = [[[NSFileManager defaultManager] directoryContentsAtPath: directory] objectEnumerator];
    417             while ((sound = [soundEnumerator nextObject]))
     414            NSArray * directoryContents = [[NSFileManager defaultManager] directoryContentsAtPath: directory];
     415            for (NSString * sound in directoryContents)
    418416            {
    419417                sound = [sound stringByDeletingPathExtension];
     
    422420            }
    423421        }
     422    }
    424423   
    425424    return sounds;
     
    946945    {
    947946        valid = true;
    948         NSEnumerator * enumerator = [components objectEnumerator];
    949         NSString * component;
    950         while ((component = [enumerator nextObject]))
     947        for (NSString * component in components)
    951948        {
    952949            if ([component isEqualToString: @"*"])
     
    11431140        NSToolbar * toolbar = [window toolbar];
    11441141        NSString * itemIdentifier = [toolbar selectedItemIdentifier];
    1145         NSEnumerator * enumerator = [[toolbar items] objectEnumerator];
    1146         NSToolbarItem * item;
    1147         while ((item = [enumerator nextObject]))
     1142        for (NSToolbarItem * item in [toolbar items])
    11481143            if ([[item itemIdentifier] isEqualToString: itemIdentifier])
    11491144            {
Note: See TracChangeset for help on using the changeset viewer.