Blender Git Commit Log

Git Commits -> Revision 313a1c0

Revision 313a1c0 by Jacques Lucke (master)
April 30, 2021, 14:23 (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: 313a1c072d6d730e4665350befb6cfae5e03b1aa
Parent Commit: e7274f9
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)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021