Explorar o código

Merge pull request #77197 from AThousandShips/string_name_cmp

Fix `StringName` comparison
Yuri Sizov %!s(int64=2) %!d(string=hai) anos
pai
achega
77991a048c
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      core/string/string_name.h

+ 9 - 0
core/string/string_name.h

@@ -117,6 +117,15 @@ public:
 	_FORCE_INLINE_ bool operator<(const StringName &p_name) const {
 		return _data < p_name._data;
 	}
+	_FORCE_INLINE_ bool operator<=(const StringName &p_name) const {
+		return _data <= p_name._data;
+	}
+	_FORCE_INLINE_ bool operator>(const StringName &p_name) const {
+		return _data > p_name._data;
+	}
+	_FORCE_INLINE_ bool operator>=(const StringName &p_name) const {
+		return _data >= p_name._data;
+	}
 	_FORCE_INLINE_ bool operator==(const StringName &p_name) const {
 		// the real magic of all this mess happens here.
 		// this is why path comparisons are very fast