summaryrefslogtreecommitdiff
path: root/core/ustring.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-24 12:50:33 -0300
committerGitHub <noreply@github.com>2016-06-24 12:50:33 -0300
commit7c4221f62aba064718301e0de69c0edc3bb1ae3b (patch)
tree26e211b7d8ac39a55757ac1c446139133323fae0 /core/ustring.cpp
parent95e3279d34fd99bf816a19a7c0dc5a2d58e418e6 (diff)
parentf4dfa37a23629e011dac74911a87860edf83c63d (diff)
Merge pull request #5387 from vnen/fix-strrange-comparison
Fix bug in String==StrRange comparison
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r--core/ustring.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index ea9a9d903e..4dbe41890d 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -257,13 +257,10 @@ bool String::operator==(const StrRange &p_range) const {
return true;
const CharType *c_str=p_range.c_str;
-
- int l=length();
-
- const CharType *dst = p_range.c_str;
+ const CharType *dst = &operator[](0);
/* Compare char by char */
- for (int i=0;i<l;i++) {
+ for (int i=0;i<len;i++) {
if (c_str[i]!=dst[i])
return false;