diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-05-06 16:20:20 +0200 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-05-08 12:37:42 +0200 |
commit | a0dbdcc3abbd3e6307c6e68d0e60f8c0fa31d576 (patch) | |
tree | 0b8d0a36f69e28096b06956ebbe2c5e6f7e403a3 /editor/debugger | |
parent | 281fe39929303a8ef12e72ff7999b849bbe0678d (diff) | |
download | redot-engine-a0dbdcc3abbd3e6307c6e68d0e60f8c0fa31d576.tar.gz |
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
Diffstat (limited to 'editor/debugger')
-rw-r--r-- | editor/debugger/debug_adapter/debug_adapter_parser.cpp | 2 | ||||
-rw-r--r-- | editor/debugger/editor_debugger_node.cpp | 2 | ||||
-rw-r--r-- | editor/debugger/editor_file_server.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/editor/debugger/debug_adapter/debug_adapter_parser.cpp b/editor/debugger/debug_adapter/debug_adapter_parser.cpp index 3c0420d2f0..4210baeed2 100644 --- a/editor/debugger/debug_adapter/debug_adapter_parser.cpp +++ b/editor/debugger/debug_adapter/debug_adapter_parser.cpp @@ -358,7 +358,7 @@ Dictionary DebugAdapterParser::req_setBreakpoints(const Dictionary &p_params) co } // If path contains \, it's a Windows path, so we need to convert it to /, and make the drive letter uppercase - if (source.path.find("\\") != -1) { + if (source.path.contains("\\")) { source.path = source.path.replace("\\", "/"); source.path = source.path.substr(0, 1).to_upper() + source.path.substr(1); } diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 3ee8a33e70..931e360a34 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -262,7 +262,7 @@ void EditorDebuggerNode::set_keep_open(bool p_keep_open) { } Error EditorDebuggerNode::start(const String &p_uri) { - ERR_FAIL_COND_V(p_uri.find("://") < 0, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(!p_uri.contains("://"), ERR_INVALID_PARAMETER); if (keep_open && current_uri == p_uri && server.is_valid()) { return OK; } diff --git a/editor/debugger/editor_file_server.cpp b/editor/debugger/editor_file_server.cpp index e84eb14636..1092b07054 100644 --- a/editor/debugger/editor_file_server.cpp +++ b/editor/debugger/editor_file_server.cpp @@ -80,7 +80,7 @@ void EditorFileServer::_scan_files_changed(EditorFileSystemDirectory *efd, const _add_file(remapped_path, mt, files_to_send, cached_files); } else if (remap.begins_with("path.")) { String feature = remap.get_slice(".", 1); - if (p_tags.find(feature) != -1) { + if (p_tags.has(feature)) { String remapped_path = cf->get_value("remap", remap); uint64_t mt = FileAccess::get_modified_time(remapped_path); _add_file(remapped_path, mt, files_to_send, cached_files); |