summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-02-22 09:55:27 +0100
committerGitHub <noreply@github.com>2019-02-22 09:55:27 +0100
commit726f31e992f544b73d8209eb95cc3d4ee501a0f0 (patch)
tree1d0631bd46efc30bb32ccc73c3797c322ad1150f /core
parentc700d714bb8dad0b6aae525f880d2ee2d679e7b6 (diff)
parentc11e7ffd0ef0f34c00447efc1a95b57e3078f06f (diff)
Merge pull request #26132 from marxin/fix-Wignored-qualifiers
Fix warnings seen with -Wignored-qualifiers.
Diffstat (limited to 'core')
-rw-r--r--core/ustring.cpp2
-rw-r--r--core/ustring.h8
2 files changed, 4 insertions, 6 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 17b52035dd..b9914fb530 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -2393,7 +2393,7 @@ int String::find(const char *p_str, int p_from) const {
return -1;
}
-int String::find_char(CharType p_char, int p_from) const {
+int String::find_char(const CharType &p_char, int p_from) const {
return _cowdata.find(p_char, p_from);
}
diff --git a/core/ustring.h b/core/ustring.h
index 5ec5c79e2d..cb3d87378a 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -85,8 +85,7 @@ public:
_FORCE_INLINE_ int size() const { return _cowdata.size(); }
Error resize(int p_size) { return _cowdata.resize(p_size); }
- _FORCE_INLINE_ char get(int p_index) { return _cowdata.get(p_index); }
- _FORCE_INLINE_ const char get(int p_index) const { return _cowdata.get(p_index); }
+ _FORCE_INLINE_ char get(int p_index) const { return _cowdata.get(p_index); }
_FORCE_INLINE_ void set(int p_index, const char &p_elem) { _cowdata.set(p_index, p_elem); }
_FORCE_INLINE_ const char &operator[](int p_index) const {
if (unlikely(p_index == _cowdata.size()))
@@ -143,8 +142,7 @@ public:
_FORCE_INLINE_ void clear() { resize(0); }
- _FORCE_INLINE_ CharType get(int p_index) { return _cowdata.get(p_index); }
- _FORCE_INLINE_ const CharType get(int p_index) const { return _cowdata.get(p_index); }
+ _FORCE_INLINE_ CharType get(int p_index) const { return _cowdata.get(p_index); }
_FORCE_INLINE_ void set(int p_index, const CharType &p_elem) { _cowdata.set(p_index, p_elem); }
_FORCE_INLINE_ int size() const { return _cowdata.size(); }
Error resize(int p_size) { return _cowdata.resize(p_size); }
@@ -197,7 +195,7 @@ public:
String substr(int p_from, int p_chars) const;
int find(const String &p_str, int p_from = 0) const; ///< return <0 if failed
int find(const char *p_str, int p_from = 0) const; ///< return <0 if failed
- int find_char(CharType p_char, int p_from = 0) const; ///< return <0 if failed
+ int find_char(const CharType &p_char, int p_from = 0) const; ///< return <0 if failed
int find_last(const String &p_str) const; ///< return <0 if failed
int findn(const String &p_str, int p_from = 0) const; ///< return <0 if failed, case insensitive
int rfind(const String &p_str, int p_from = -1) const; ///< return <0 if failed