Show
Ignore:
Timestamp:
04/26/07 15:07:53 (2 years ago)
Author:
morris
Message:

Random stuff

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Footagehead/trunk/FHHTMLParser.m

    r4724 r4726  
    4646        NSArray                 *tokens; 
    4747        NSSet                   *types; 
    48         NSString                *token, *link, *path
     48        NSString                *token, *link, *path, *extension
    4949        WIURL                   *url; 
    5050        NSUInteger              i, count, length; 
    5151         
    52         links = [NSMutableArray arrayWithCapacity:50]; 
    53         set = [NSMutableSet setWithCapacity:50]; 
    54         length = [html length]; 
    55         skipSet = [NSCharacterSet characterSetWithCharactersInString:@" =\r\n\t\"\'<>"]; 
     52        links   = [NSMutableArray arrayWithCapacity:50]; 
     53        length  = [html length]; 
     54        skipSet = [NSCharacterSet characterSetWithCharactersInString:@" =\r\n\t\"\'<>"]; 
    5655         
    5756        switch(type) { 
     
    8281                        if([scanner scanUpToString:token intoString:NULL]) { 
    8382                                if([scanner scanString:token intoString:NULL]) { 
    84                                         if([scanner scanUpToCharactersFromSet:skipSet intoString:&link]) { 
    85                                                 if(![set containsObject:link]) { 
    86                                                         [links addObject:link]; 
    87                                                         [set addObject:link]; 
    88                                                 } 
    89                                         } 
     83                                        if([scanner scanUpToCharactersFromSet:skipSet intoString:&link]) 
     84                                                [links addObject:link]; 
    9085                                } 
    9186                        } 
     
    9590        } 
    9691         
    97         count = [links count]; 
    98         urls = [NSMutableArray arrayWithCapacity:count]; 
    99         types = [NSSet setWithArray:[NSImage FHImageFileTypes]]; 
     92        count   = [links count]; 
     93        urls    = [NSMutableArray arrayWithCapacity:count]; 
     94        set             = [NSMutableSet setWithCapacity:count]; 
     95        types   = [NSSet setWithArray:[NSImage FHImageFileTypes]]; 
    10096         
    10197        for(i = 0; i < count; i++) { 
    10298                link = [links objectAtIndex:i]; 
     99                extension = [link pathExtension]; 
    103100                 
    104                 if(![types containsObject:[link pathExtension]])  
     101                if(![types containsObject:extension])  
     102                        continue; 
     103                 
     104                if([extension isEqualToString:@"ico"]) 
    105105                        continue; 
    106106                 
     
    124124                } 
    125125                 
    126                 [urls addObject:url]; 
     126                if(![set containsObject:url]) { 
     127                        [urls addObject:url]; 
     128                        [set addObject:url]; 
     129                } 
    127130        } 
    128131