diff options
author | Julian Eisel <julian@blender.org> | 2022-08-17 17:25:36 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-08-17 21:27:52 +0300 |
commit | ecf4a7835d5b6b02194f97af6c6b343a1352d83d (patch) | |
tree | e7f0057203d632fa56f911fe478b7bed41d3a57c | |
parent | 31279d522be289c5dbb68e26673eb588cee76252 (diff) |
Outliner: Avoid unnecessary Outliner storage copy
Was always creating a copy of `SpaceOutliner`, even though it's only
needed for one conditional branch. This is a shallow copy, so shouldn't
be that expensive, still trivial to avoid.
-rw-r--r-- | source/blender/blenkernel/intern/screen.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index c16a0927365..66ec887b3d4 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -1128,8 +1128,6 @@ static void write_space_outliner(BlendWriter *writer, SpaceOutliner *space_outli BLI_mempool *ts = space_outliner->treestore; if (ts) { - SpaceOutliner space_outliner_flat = *space_outliner; - int elems = BLI_mempool_len(ts); /* linearize mempool to array */ TreeStoreElem *data = elems ? BLI_mempool_as_arrayN(ts, "TreeStoreElem") : NULL; @@ -1157,6 +1155,7 @@ static void write_space_outliner(BlendWriter *writer, SpaceOutliner *space_outli MEM_freeN(data); } else { + SpaceOutliner space_outliner_flat = *space_outliner; space_outliner_flat.treestore = NULL; BLO_write_struct_at_address(writer, SpaceOutliner, space_outliner, &space_outliner_flat); } |