Kaynağa Gözat

Merge pull request #107380 from Ivorforce/no-stringname-search

Core: Remove unused `StringName::search`.
Rémi Verschelde 2 ay önce
ebeveyn
işleme
7f925a104f
2 değiştirilmiş dosya ile 0 ekleme ve 97 silme
  1. 0 93
      core/string/string_name.cpp
  2. 0 4
      core/string/string_name.h

+ 0 - 93
core/string/string_name.cpp

@@ -314,99 +314,6 @@ StringName::StringName(const String &p_name, bool p_static) {
 	Table::table[idx] = _data;
 }
 
-StringName StringName::search(const char *p_name) {
-	ERR_FAIL_COND_V(!configured, StringName());
-
-	ERR_FAIL_NULL_V(p_name, StringName());
-	if (!p_name[0]) {
-		return StringName();
-	}
-
-	const uint32_t hash = String::hash(p_name);
-	const uint32_t idx = hash & Table::TABLE_MASK;
-
-	MutexLock lock(Table::mutex);
-	_Data *_data = Table::table[idx];
-
-	while (_data) {
-		// compare hash first
-		if (_data->hash == hash && _data->name == p_name) {
-			break;
-		}
-		_data = _data->next;
-	}
-
-	if (_data && _data->refcount.ref()) {
-#ifdef DEBUG_ENABLED
-		if (unlikely(debug_stringname)) {
-			_data->debug_references++;
-		}
-#endif
-
-		return StringName(_data);
-	}
-
-	return StringName(); //does not exist
-}
-
-StringName StringName::search(const char32_t *p_name) {
-	ERR_FAIL_COND_V(!configured, StringName());
-
-	ERR_FAIL_NULL_V(p_name, StringName());
-	if (!p_name[0]) {
-		return StringName();
-	}
-
-	const uint32_t hash = String::hash(p_name);
-	const uint32_t idx = hash & Table::TABLE_MASK;
-
-	MutexLock lock(Table::mutex);
-	_Data *_data = Table::table[idx];
-
-	while (_data) {
-		// compare hash first
-		if (_data->hash == hash && _data->name == p_name) {
-			break;
-		}
-		_data = _data->next;
-	}
-
-	if (_data && _data->refcount.ref()) {
-		return StringName(_data);
-	}
-
-	return StringName(); //does not exist
-}
-
-StringName StringName::search(const String &p_name) {
-	ERR_FAIL_COND_V(p_name.is_empty(), StringName());
-
-	const uint32_t hash = p_name.hash();
-	const uint32_t idx = hash & Table::TABLE_MASK;
-
-	MutexLock lock(Table::mutex);
-	_Data *_data = Table::table[idx];
-
-	while (_data) {
-		// compare hash first
-		if (_data->hash == hash && _data->name == p_name) {
-			break;
-		}
-		_data = _data->next;
-	}
-
-	if (_data && _data->refcount.ref()) {
-#ifdef DEBUG_ENABLED
-		if (unlikely(debug_stringname)) {
-			_data->debug_references++;
-		}
-#endif
-		return StringName(_data);
-	}
-
-	return StringName(); //does not exist
-}
-
 bool operator==(const String &p_name, const StringName &p_string_name) {
 	return p_string_name.operator==(p_name);
 }

+ 0 - 4
core/string/string_name.h

@@ -134,10 +134,6 @@ public:
 		return String();
 	}
 
-	static StringName search(const char *p_name);
-	static StringName search(const char32_t *p_name);
-	static StringName search(const String &p_name);
-
 	struct AlphCompare {
 		template <typename LT, typename RT>
 		_FORCE_INLINE_ bool operator()(const LT &l, const RT &r) const {