Replace String comparisons with "", String() to is_empty()
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
This commit is contained in:
@ -117,7 +117,7 @@ void GDScriptCache::remove_script(const String &p_path) {
|
||||
Ref<GDScriptParserRef> GDScriptCache::get_parser(const String &p_path, GDScriptParserRef::Status p_status, Error &r_error, const String &p_owner) {
|
||||
MutexLock lock(singleton->lock);
|
||||
Ref<GDScriptParserRef> ref;
|
||||
if (p_owner != String()) {
|
||||
if (!p_owner.is_empty()) {
|
||||
singleton->dependencies[p_owner].insert(p_path);
|
||||
}
|
||||
if (singleton->parser_map.has(p_path)) {
|
||||
@ -163,7 +163,7 @@ String GDScriptCache::get_source_code(const String &p_path) {
|
||||
|
||||
Ref<GDScript> GDScriptCache::get_shallow_script(const String &p_path, const String &p_owner) {
|
||||
MutexLock lock(singleton->lock);
|
||||
if (p_owner != String()) {
|
||||
if (!p_owner.is_empty()) {
|
||||
singleton->dependencies[p_owner].insert(p_path);
|
||||
}
|
||||
if (singleton->full_gdscript_cache.has(p_path)) {
|
||||
@ -186,7 +186,7 @@ Ref<GDScript> GDScriptCache::get_shallow_script(const String &p_path, const Stri
|
||||
Ref<GDScript> GDScriptCache::get_full_script(const String &p_path, Error &r_error, const String &p_owner) {
|
||||
MutexLock lock(singleton->lock);
|
||||
|
||||
if (p_owner != String()) {
|
||||
if (!p_owner.is_empty()) {
|
||||
singleton->dependencies[p_owner].insert(p_path);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user