Updated the logic of a few getters in String.

This commit is contained in:
Relintai 2023-03-22 01:42:53 +01:00
parent 0ed384eb1c
commit d357a57ab2

View File

@ -60,7 +60,7 @@ public:
_cowdata(p_other._cowdata) {}
_FORCE_INLINE_ operator T() const {
if (unlikely(_index == _cowdata.size())) {
if (unlikely(_cowdata.size() == 0)) {
return _null;
}
@ -106,7 +106,7 @@ public:
_FORCE_INLINE_ char16_t get(int p_index) const { return _cowdata.get(p_index); }
_FORCE_INLINE_ void set(int p_index, const char16_t &p_elem) { _cowdata.set(p_index, p_elem); }
_FORCE_INLINE_ const char16_t &operator[](int p_index) const {
if (unlikely(p_index == _cowdata.size())) {
if (unlikely(_cowdata.size() == 0)) {
return _null;
}
@ -156,7 +156,7 @@ public:
_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())) {
if (unlikely(_cowdata.size() == 0)) {
return _null;
}