| 735 | |
| 736 | |
| 737 | static void EraseSwapLevelIndex(Collection* collection, HInstance instance) |
| 738 | { |
| 739 | /* |
| 740 | * Remove instance from m_LevelIndices using an erase-swap operation |
| 741 | */ |
| 742 | |
| 743 | dmArray<uint16_t>& level = collection->m_LevelIndices[instance->m_Depth]; |
| 744 | assert(level.Size() > 0); |
| 745 | assert(instance->m_LevelIndex < level.Size()); |
| 746 | |
| 747 | uint16_t level_index = instance->m_LevelIndex; |
| 748 | uint16_t swap_in_index = level.EraseSwap(level_index); |
| 749 | HInstance swap_in_instance = collection->m_Instances[swap_in_index]; |
| 750 | assert(swap_in_instance->m_Index == swap_in_index); |
| 751 | swap_in_instance->m_LevelIndex = level_index; |
| 752 | } |
| 753 | |
| 754 | /* |
| 755 | * Heuristic for expanding the level indices arrays: |
no test coverage detected