diff options
author | Anilforextra <anilforextra@gmail.com> | 2022-02-03 21:48:38 +0545 |
---|---|---|
committer | Anilforextra <anilforextra@gmail.com> | 2022-02-04 01:28:02 +0545 |
commit | adbe948bda202209b55249198e1837324e703ddb (patch) | |
tree | a7f424318e1d944e0564edb6fc55e8eabf266bd0 /editor/import | |
parent | bf12719ccabcea9bf9b274f77511e02581678774 (diff) |
String: Add contains().
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/collada.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/import/collada.cpp b/editor/import/collada.cpp index b40a810763..605f385de2 100644 --- a/editor/import/collada.cpp +++ b/editor/import/collada.cpp @@ -287,7 +287,7 @@ void Collada::_parse_image(XMLParser &parser) { if (state.version < State::Version(1, 4, 0)) { /* <1.4 */ String path = parser.get_attribute_value("source").strip_edges(); - if (path.find("://") == -1 && path.is_relative_path()) { + if (!path.contains("://") && path.is_relative_path()) { // path is relative to file being loaded, so convert to a resource path image.path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir().plus_file(path.uri_decode())); } @@ -300,7 +300,7 @@ void Collada::_parse_image(XMLParser &parser) { parser.read(); String path = parser.get_node_data().strip_edges().uri_decode(); - if (path.find("://") == -1 && path.is_relative_path()) { + if (!path.contains("://") && path.is_relative_path()) { // path is relative to file being loaded, so convert to a resource path path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir().plus_file(path)); @@ -1832,10 +1832,10 @@ void Collada::_parse_animation(XMLParser &parser) { } } - if (target.find("/") != -1) { //transform component + if (target.contains("/")) { //transform component track.target = target.get_slicec('/', 0); track.param = target.get_slicec('/', 1); - if (track.param.find(".") != -1) { + if (track.param.contains(".")) { track.component = track.param.get_slice(".", 1).to_upper(); } track.param = track.param.get_slice(".", 0); |