Blender Git Loki

Git Commits -> Revision d346431

May 1, 2021, 08:12 (GMT)
BLI: support removing Map elements during iteration

While it was technically safe to call Map.remove while iterating over
a map, it wasn't really designed to work. Also it wasn't very efficient,
because to remove the element, the map would have to search it
again. Now it is possible to remove an element given an iterator
into the map. It is safe to remove the element while iterating over
the map. Obviously, the removed element must not be accessed
anymore after it has been removed.

Commit Details:

Full Hash: d3464315f02e2744fc5ccd19ab5a18c11338c258
Parent Commit: 6fd0c7a
Committed By: YimingWu
Lines Changed: +40, -0

2 Modified Paths:

/source/blender/blenlib/BLI_map.hh (+13, -0) (Diff)
/source/blender/blenlib/tests/BLI_map_test.cc (+27, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021