summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-04 14:25:58 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-04 14:25:58 +0100
commit0fa767beff83d4570f7dcbf683d983eb76b449ac (patch)
tree33315e38ad124eaa0e0eb6f68a5cf4ac100781e8 /core
parent3224e47af8a8b0666be867f271192416232b1ac1 (diff)
parent8f6e8ef0d7b3ae91cd8719f05761cc35e1c9cd13 (diff)
downloadredot-engine-0fa767beff83d4570f7dcbf683d983eb76b449ac.tar.gz
Merge pull request #84508 from jsjtxietian/clean-copy
Clean unnecessary copy detected by clang-tidy
Diffstat (limited to 'core')
-rw-r--r--core/io/resource_saver.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp
index 1c6c18b015..51ebea7f2c 100644
--- a/core/io/resource_saver.cpp
+++ b/core/io/resource_saver.cpp
@@ -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);
- Ref<Resource> rwcopy = p_resource;
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);
@@ -139,7 +138,7 @@ Error ResourceSaver::save(const Ref<Resource> &p_resource, const String &p_path,
#endif
if (p_flags & FLAG_CHANGE_PATH) {
- rwcopy->set_path(old_path);
+ p_resource->set_path(old_path);
}
if (save_callback && path.begins_with("res://")) {