File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -234,10 +234,10 @@ void String::move(String &rhs)
234
234
String & String::operator = (const String &rhs)
235
235
{
236
236
if (this == &rhs) return *this ;
237
-
237
+
238
238
if (rhs.buffer ) copy (rhs.buffer , rhs.len );
239
239
else invalidate ();
240
-
240
+
241
241
return *this ;
242
242
}
243
243
@@ -253,7 +253,7 @@ String & String::operator = (const char *cstr)
253
253
{
254
254
if (cstr) copy (cstr, strlen (cstr));
255
255
else invalidate ();
256
-
256
+
257
257
return *this ;
258
258
}
259
259
@@ -484,7 +484,7 @@ bool String::equalsIgnoreCase( const String &s2 ) const
484
484
const char *p2 = s2.buffer ;
485
485
while (*p1) {
486
486
if (tolower (*p1++) != tolower (*p2++)) return false ;
487
- }
487
+ }
488
488
return true ;
489
489
}
490
490
@@ -515,7 +515,7 @@ char String::charAt(unsigned int loc) const
515
515
return operator [](loc);
516
516
}
517
517
518
- void String::setCharAt (unsigned int loc, char c)
518
+ void String::setCharAt (unsigned int loc, char c)
519
519
{
520
520
if (loc < len) buffer[loc] = c;
521
521
}
@@ -652,9 +652,9 @@ void String::replace(const String& find, const String& replace)
652
652
}
653
653
} else if (diff < 0 ) {
654
654
unsigned int size = len; // compute size needed for result
655
+ diff = 0 - diff;
655
656
while ((foundAt = strstr (readFrom, find.buffer )) != NULL ) {
656
657
readFrom = foundAt + find.len ;
657
- diff = 0 - diff;
658
658
size -= diff;
659
659
}
660
660
if (size == len) return ;
You can’t perform that action at this time.
0 commit comments