fix: Fix for failing test in NSString+Utilities
The test in TestNSString+Utilities would otherwise fail: ====================================================================== FAIL: test_countOccurrencesOfString (TestNSString+Utilities.m:46) ---------------------------------------------------------------------- assertion failure Simply leave the loop early if the substring length is zero to avoid this issuepull/276/head
parent
2e0fc3ca09
commit
fc863bf63f
|
@ -739,7 +739,7 @@ static int cssEscapingCount;
|
|||
substrLen = [substring length];
|
||||
|
||||
matchRange = NSMakeRange (0, selfLen);
|
||||
while (!done)
|
||||
while (!done && matchRange.length > 0)
|
||||
{
|
||||
substrRange = [self rangeOfString: substring options: 0 range: matchRange];
|
||||
if (substrRange.location == NSNotFound)
|
||||
|
|
Loading…
Reference in New Issue