Browse Source

Move StringName != to the header file to make it inlineable.

Lukas Tenbrink 8 months ago
parent
commit
a47d29cf11
2 changed files with 5 additions and 9 deletions
  1. 0 6
      core/string/string_name.cpp
  2. 5 3
      core/string/string_name.h

+ 0 - 6
core/string/string_name.cpp

@@ -191,12 +191,6 @@ bool StringName::operator!=(const char *p_name) const {
 	return !(operator==(p_name));
 	return !(operator==(p_name));
 }
 }
 
 
-bool StringName::operator!=(const StringName &p_name) const {
-	// the real magic of all this mess happens here.
-	// this is why path comparisons are very fast
-	return _data != p_name._data;
-}
-
 char32_t StringName::operator[](int p_index) const {
 char32_t StringName::operator[](int p_index) const {
 	if (_data) {
 	if (_data) {
 		if (_data->cname) {
 		if (_data->cname) {

+ 5 - 3
core/string/string_name.h

@@ -132,10 +132,13 @@ public:
 		return _data >= p_name._data;
 		return _data >= p_name._data;
 	}
 	}
 	_FORCE_INLINE_ bool operator==(const StringName &p_name) const {
 	_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
+		// The real magic of all this mess happens here.
+		// This is why path comparisons are very fast.
 		return _data == p_name._data;
 		return _data == p_name._data;
 	}
 	}
+	_FORCE_INLINE_ bool operator!=(const StringName &p_name) const {
+		return _data != p_name._data;
+	}
 	_FORCE_INLINE_ uint32_t hash() const {
 	_FORCE_INLINE_ uint32_t hash() const {
 		if (_data) {
 		if (_data) {
 			return _data->hash;
 			return _data->hash;
@@ -146,7 +149,6 @@ public:
 	_FORCE_INLINE_ const void *data_unique_pointer() const {
 	_FORCE_INLINE_ const void *data_unique_pointer() const {
 		return (void *)_data;
 		return (void *)_data;
 	}
 	}
-	bool operator!=(const StringName &p_name) const;
 
 
 	_FORCE_INLINE_ operator String() const {
 	_FORCE_INLINE_ operator String() const {
 		if (_data) {
 		if (_data) {