Changeset 12900


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

improvements to betterComponentsSeparatedByCharactersInSet:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/NSStringAdditions.m

    r12899 r12900  
    187187    NSMutableArray * components = [NSMutableArray array];
    188188   
    189     for (NSUInteger i = 0; i < [self length];)
     189    NSUInteger i = 0;
     190    while (i < [self length])
    190191    {
    191192        const NSRange range = [self rangeOfCharacterFromSet: separator options: 0 range: NSMakeRange(i, [self length]-i)];
     
    202203            if (range.location == NSNotFound)
    203204                break;
    204             i += length + range.length;
     205            i += length;
    205206        }
     207        i += range.length;
    206208    }
    207209   
Note: See TracChangeset for help on using the changeset viewer.