Merge pull request #84508 from jsjtxietian/clean-copy

Clean unnecessary copy detected by clang-tidy
This commit is contained in:
Rémi Verschelde 2024-01-04 14:25:58 +01:00
commit 0fa767beff
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 3 additions and 5 deletions

View File

@ -120,9 +120,8 @@ Error ResourceSaver::save(const Ref<Resource> &p_resource, const String &p_path,
String local_path = ProjectSettings::get_singleton()->localize_path(path); String local_path = ProjectSettings::get_singleton()->localize_path(path);
Ref<Resource> rwcopy = p_resource;
if (p_flags & FLAG_CHANGE_PATH) { if (p_flags & FLAG_CHANGE_PATH) {
rwcopy->set_path(local_path); p_resource->set_path(local_path);
} }
err = saver[i]->save(p_resource, path, p_flags); err = saver[i]->save(p_resource, path, p_flags);
@ -139,7 +138,7 @@ Error ResourceSaver::save(const Ref<Resource> &p_resource, const String &p_path,
#endif #endif
if (p_flags & FLAG_CHANGE_PATH) { if (p_flags & FLAG_CHANGE_PATH) {
rwcopy->set_path(old_path); p_resource->set_path(old_path);
} }
if (save_callback && path.begins_with("res://")) { if (save_callback && path.begins_with("res://")) {

View File

@ -2377,9 +2377,8 @@ Node *ResourceImporterScene::pre_import(const String &p_source_file, const HashM
ERR_FAIL_COND_V(!importer.is_valid(), nullptr); ERR_FAIL_COND_V(!importer.is_valid(), nullptr);
Error err = OK; Error err = OK;
HashMap<StringName, Variant> options_dupe = p_options;
Node *scene = importer->import_scene(p_source_file, EditorSceneFormatImporter::IMPORT_ANIMATION | EditorSceneFormatImporter::IMPORT_GENERATE_TANGENT_ARRAYS | EditorSceneFormatImporter::IMPORT_FORCE_DISABLE_MESH_COMPRESSION, options_dupe, nullptr, &err); Node *scene = importer->import_scene(p_source_file, EditorSceneFormatImporter::IMPORT_ANIMATION | EditorSceneFormatImporter::IMPORT_GENERATE_TANGENT_ARRAYS | EditorSceneFormatImporter::IMPORT_FORCE_DISABLE_MESH_COMPRESSION, p_options, nullptr, &err);
if (!scene || err != OK) { if (!scene || err != OK) {
return nullptr; return nullptr;
} }