Changes between Initial Version and Version 1 of Ticket #1707, comment 31


Ignore:
Timestamp:
Jul 25, 2013, 4:00:47 PM (9 years ago)
Author:
Jorma Rebane

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1707, comment 31

    initial v1  
    44
    55
    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 :)
     6It 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 :)
    77
    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.
     8When we iterate over the entitymap, we can do 2 things to fix it:
     91) Write a custom iterator (easy) that skips handles with '-1' (invalid).
     102) Let the code itself handle it: if(it->first == -1) continue;
     11
     12Another 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.
    913
    1014I 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 :)