~TrieNode() { if(ChildCount == 0) return; else if(ChildCount > MAX_LIST_ELEMENTS) { DeallocateArray(); } else DeallocateList(ChildrenListHead, true); }
void DeallocateList(TrieList* node, bool deallocateNodes) { if(node->Next) { DeallocateList(node->Next, deallocateNodes); } if(deallocateNodes) { delete node->Node; } delete node; }
void ConvertListToArray() { assert(ChildrenListHead != nullptr); TrieNode** array = AllocateArray(); TrieList* listNode = ChildrenListHead; while(listNode) { array[listNode->Value] = listNode->Node; listNode = listNode->Next; } DeallocateList(ChildrenListHead, false); ChildrenArray = array; }
void CDerivedDisplaySettingsListView::SetAllItems( void ) { DeallocateList(); AllocateList(); SetList(); };