Merge pull request #5387 from vnen/fix-strrange-comparison
Fix bug in String==StrRange comparison
This commit is contained in:
commit
7c4221f62a
@ -257,13 +257,10 @@ bool String::operator==(const StrRange &p_range) const {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
const CharType *c_str=p_range.c_str;
|
const CharType *c_str=p_range.c_str;
|
||||||
|
const CharType *dst = &operator[](0);
|
||||||
int l=length();
|
|
||||||
|
|
||||||
const CharType *dst = p_range.c_str;
|
|
||||||
|
|
||||||
/* Compare char by char */
|
/* Compare char by char */
|
||||||
for (int i=0;i<l;i++) {
|
for (int i=0;i<len;i++) {
|
||||||
|
|
||||||
if (c_str[i]!=dst[i])
|
if (c_str[i]!=dst[i])
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user