Changeset 12901


Ignore:
Timestamp:
Sep 19, 2011, 2:00:52 AM (10 years ago)
Author:
livings124
Message:

even more work on betterComponentsSeparatedByCharactersInSet:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/NSStringAdditions.m

    r12900 r12901  
    194194        if (range.location != i)
    195195        {
    196             NSUInteger length;
    197196            if (range.location == NSNotFound)
    198                 length = [self length] - i;
     197            {
     198                [components addObject: [self substringFromIndex: i]];
     199                break;
     200            }
    199201            else
    200                 length = range.location - i;
    201             [components addObject: [self substringWithRange: NSMakeRange(i, length)]];
    202            
    203             if (range.location == NSNotFound)
    204                 break;
    205             i += length;
     202            {
     203                const NSUInteger length = range.location - i;
     204                [components addObject: [self substringWithRange: NSMakeRange(i, length)]];
     205               
     206                i += length;
     207            }
    206208        }
    207209        i += range.length;
Note: See TracChangeset for help on using the changeset viewer.