mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add Span equality (== and !=) operators.
Exchange duplicate equality iteration implementations across `Vector` and `String` with the `Span` version, for a speed boost.
This commit is contained in:
parent
ef34c3d534
commit
d7f5c13db8
5 changed files with 44 additions and 98 deletions
|
|
@ -211,12 +211,7 @@ public:
|
|||
_FORCE_INLINE_ CharStringT(const T *p_cstr) { copy_from(p_cstr); }
|
||||
_FORCE_INLINE_ void operator=(const T *p_cstr) { copy_from(p_cstr); }
|
||||
|
||||
_FORCE_INLINE_ bool operator==(const CharStringT<T> &p_other) const {
|
||||
if (length() != p_other.length()) {
|
||||
return false;
|
||||
}
|
||||
return memcmp(ptr(), p_other.ptr(), length() * sizeof(T)) == 0;
|
||||
}
|
||||
_FORCE_INLINE_ bool operator==(const CharStringT<T> &p_other) const { return span() == p_other.span(); }
|
||||
_FORCE_INLINE_ bool operator!=(const CharStringT<T> &p_other) const { return !(*this == p_other); }
|
||||
_FORCE_INLINE_ bool operator<(const CharStringT<T> &p_other) const {
|
||||
if (length() == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue