浏览代码

Fix `StringName` comparison

Ninni Pipping 2 年之前
父节点
当前提交
d2ddd8b228
共有 1 个文件被更改,包括 9 次插入0 次删除
  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