You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +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:
@@ -493,7 +493,7 @@ void CodeHighlighter::add_color_region(const String &p_start_key, const String &
|
||||
color_region.color = p_color;
|
||||
color_region.start_key = p_start_key;
|
||||
color_region.end_key = p_end_key;
|
||||
color_region.line_only = p_line_only || p_end_key == "";
|
||||
color_region.line_only = p_line_only || p_end_key.is_empty();
|
||||
color_regions.insert(at, color_region);
|
||||
clear_highlighting_cache();
|
||||
}
|
||||
@@ -529,7 +529,7 @@ void CodeHighlighter::set_color_regions(const Dictionary &p_color_regions) {
|
||||
String start_key = key.get_slice(" ", 0);
|
||||
String end_key = key.get_slice_count(" ") > 1 ? key.get_slice(" ", 1) : String();
|
||||
|
||||
add_color_region(start_key, end_key, p_color_regions[key], end_key == "");
|
||||
add_color_region(start_key, end_key, p_color_regions[key], end_key.is_empty());
|
||||
}
|
||||
clear_highlighting_cache();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user