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/makesrna/intern/rna_ID.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/makesrna/intern/rna_ID.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index f1c125fcbb9..320476c22b1 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -523,16 +523,12 @@ static ID *rna_ID_evaluated_get(ID *id, struct Depsgraph *depsgraph) static ID *rna_ID_copy(ID *id, Main *bmain) { - ID *newid; + ID *newid = BKE_id_copy(bmain, id); - if (BKE_id_copy(bmain, id, &newid)) { - if (newid != NULL) { - id_us_min(newid); - } - return newid; + if (newid != NULL) { + id_us_min(newid); } - - return NULL; + return newid; } static ID *rna_ID_override_create(ID *id, Main *bmain, bool remap_local_usages) |