Changes between Initial Version and Version 1 of Ticket #1707, comment 31
- Timestamp:
- Jul 25, 2013, 4:00:47 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1707, comment 31
initial v1 4 4 5 5 6 It doesn't 'break' the iterators - leaving in 'invalid' entries is intentional in order to get the speed boost. Once we start reusing entity handles, this solution will be perfect :)6 It doesn't 'break' the iterators per se - leaving in 'invalid' entries is intentional in order to get the speed boost. Once we start reusing entity handles, this solution would be quite perfect :) 7 7 8 Only issue might be current simulation code that expects size = size - 1 after erase(), which doesn't happen right now. That is easy to fix. Just search for all references with your favorite IDE and all is well. 8 When we iterate over the entitymap, we can do 2 things to fix it: 9 1) Write a custom iterator (easy) that skips handles with '-1' (invalid). 10 2) Let the code itself handle it: if(it->first == -1) continue; 11 12 Another issue might be current simulation code that expects size = size - 1 after erase(), which doesn't happen right now. That is easy to fix. Just search for all references with your favorite IDE and all is well. 9 13 10 14 I don't see why we can't use this solution though - it's pretty much the best we've got so far. I don't really care about wasting a bit of memory either. This vector never grows too big :)