Replace find with contains/has where applicable
* Replaces `find(...) != -1` with `contains` for `String` * Replaces `find(...) == -1` with `!contains` for `String` * Replaces `find(...) != -1` with `has` for containers * Replaces `find(...) == -1` with `!has` for containers
This commit is contained in:
parent
281fe39929
commit
a0dbdcc3ab
55 changed files with 219 additions and 219 deletions
|
|
@ -969,7 +969,7 @@ bool EditorSettings::_save_text_editor_theme(const String &p_file) {
|
|||
keys.sort();
|
||||
|
||||
for (const String &key : keys) {
|
||||
if (key.begins_with("text_editor/theme/highlighting/") && key.find("color") >= 0) {
|
||||
if (key.begins_with("text_editor/theme/highlighting/") && key.contains("color")) {
|
||||
cf->set_value(theme_section, key.replace("text_editor/theme/highlighting/", ""), ((Color)props[key].variant).to_html());
|
||||
}
|
||||
}
|
||||
|
|
@ -1448,7 +1448,7 @@ void EditorSettings::load_text_editor_theme() {
|
|||
// don't load if it's not already there!
|
||||
if (has_setting("text_editor/theme/highlighting/" + key)) {
|
||||
// make sure it is actually a color
|
||||
if (val.is_valid_html_color() && key.find("color") >= 0) {
|
||||
if (val.is_valid_html_color() && key.contains("color")) {
|
||||
props["text_editor/theme/highlighting/" + key].variant = Color::html(val); // change manually to prevent "Settings changed" console spam
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue