diff options
author | Bastien Montagne <bastien@blender.org> | 2020-10-07 17:13:01 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-10-07 19:05:06 +0300 |
commit | 03ef0cfe3c3327647be5289d8ecddea820401221 (patch) | |
tree | a761b84e34ca5e11a133fa393261f151249cf517 /source/blender/blenkernel/intern/lib_override.c | |
parent | 7c9131d11eb01a70db440fac7bb3f4b3833d544a (diff) |
Refactor `BKE_id_copy` to return the new ID pointer.
No reasons to keep the new ID pointer as parameter here.
Part of T71219.
Diffstat (limited to 'source/blender/blenkernel/intern/lib_override.c')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 7fd8b05ec0a..a989a865994 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -189,9 +189,9 @@ void BKE_lib_override_library_free(struct IDOverrideLibrary **override, const bo static ID *lib_override_library_create_from(Main *bmain, ID *reference_id) { - ID *local_id; + ID *local_id = BKE_id_copy(bmain, reference_id); - if (!BKE_id_copy(bmain, reference_id, (ID **)&local_id)) { + if (local_id == NULL) { return NULL; } id_us_min(local_id); @@ -1699,8 +1699,7 @@ void BKE_lib_override_library_update(Main *bmain, ID *local) * Not impossible to do, but would rather see first if extra useless usual user handling * is actually a (performances) issue here. */ - ID *tmp_id; - BKE_id_copy(bmain, local->override_library->reference, &tmp_id); + ID *tmp_id = BKE_id_copy(bmain, local->override_library->reference); if (tmp_id == NULL) { return; @@ -1868,7 +1867,7 @@ ID *BKE_lib_override_library_operations_store_start(Main *bmain, * (and possibly all over Blender code). * Not impossible to do, but would rather see first is extra useless usual user handling is * actually a (performances) issue here, before doing it. */ - BKE_id_copy((Main *)override_storage, local, &storage_id); + storage_id = BKE_id_copy((Main *)override_storage, local); if (storage_id != NULL) { PointerRNA rnaptr_reference, rnaptr_final, rnaptr_storage; |