You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
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:
@@ -110,7 +110,7 @@ void ResourcePreloaderEditor::_item_edited() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (new_name == "" || new_name.find("\\") != -1 || new_name.find("/") != -1 || preloader->has_resource(new_name)) {
|
||||
if (new_name.is_empty() || new_name.find("\\") != -1 || new_name.find("/") != -1 || preloader->has_resource(new_name)) {
|
||||
s->set_text(0, old_name);
|
||||
return;
|
||||
}
|
||||
@@ -147,10 +147,10 @@ void ResourcePreloaderEditor::_paste_pressed() {
|
||||
}
|
||||
|
||||
String name = r->get_name();
|
||||
if (name == "") {
|
||||
if (name.is_empty()) {
|
||||
name = r->get_path().get_file();
|
||||
}
|
||||
if (name == "") {
|
||||
if (name.is_empty()) {
|
||||
name = r->get_class();
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ void ResourcePreloaderEditor::drop_data_fw(const Point2 &p_point, const Variant
|
||||
|
||||
if (r.is_valid()) {
|
||||
String basename;
|
||||
if (r->get_name() != "") {
|
||||
if (!r->get_name().is_empty()) {
|
||||
basename = r->get_name();
|
||||
} else if (r->get_path().is_resource_file()) {
|
||||
basename = r->get_path().get_basename();
|
||||
|
||||
Reference in New Issue
Block a user