summaryrefslogtreecommitdiffstats
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-08 14:35:44 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-08 14:35:44 +0200
commita9a1d0a162ef6be57374519589c538205e65a7fc (patch)
tree1789441c8af84b396ca21892c332c0583abb9c48 /editor/filesystem_dock.cpp
parent1d101329c96460a8b00a8dec5ff8808a589ee505 (diff)
parenta0dbdcc3abbd3e6307c6e68d0e60f8c0fa31d576 (diff)
downloadredot-engine-a9a1d0a162ef6be57374519589c538205e65a7fc.tar.gz
Merge pull request #91619 from AThousandShips/find_improve
Replace `find` with `contains/has` where applicable
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index ef77e5340b..4c7c723dd5 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -261,7 +261,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
if (p_unfold_path && current_path.begins_with(lpath) && current_path != lpath) {
subdirectory_item->set_collapsed(false);
} else {
- subdirectory_item->set_collapsed(uncollapsed_paths.find(lpath) < 0);
+ subdirectory_item->set_collapsed(!uncollapsed_paths.has(lpath));
}
if (!searched_tokens.is_empty() && _matches_all_search_tokens(dname)) {
parent_should_expand = true;
@@ -407,7 +407,7 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo
favorites_item->set_icon(0, get_editor_theme_icon(SNAME("Favorites")));
favorites_item->set_text(0, TTR("Favorites:"));
favorites_item->set_metadata(0, "Favorites");
- favorites_item->set_collapsed(p_uncollapsed_paths.find("Favorites") < 0);
+ favorites_item->set_collapsed(!p_uncollapsed_paths.has("Favorites"));
Vector<String> favorite_paths = EditorSettings::get_singleton()->get_favorites();
@@ -2300,7 +2300,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
TreeItem *selected = tree->get_root();
selected = tree->get_next_selected(selected);
while (selected) {
- if (p_selected.find(selected->get_metadata(0)) >= 0) {
+ if (p_selected.has(selected->get_metadata(0))) {
selected->set_collapsed(false);
}
selected = tree->get_next_selected(selected);