Skip to content

Commit

Permalink
Fix CKeyValues3Table::RemoveMember method
Browse files Browse the repository at this point in the history
  • Loading branch information
Wend4r committed Dec 26, 2024
1 parent 127071c commit 6d45bbc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tier1/keyvalues3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,14 @@ void CKeyValues3Table::RemoveMember( KV3MemberId_t id )
free( (void*)pNames[ id ] );
}

KV3MemberId_t nShiftTo = id + 1;
int nHighElements = m_nCount - nShiftTo;

memmove( &HashesBase()[id], &HashesBase()[nShiftTo], nHighElements * sizeof(Hash_t) );
memmove( &MembersBase()[id], &MembersBase()[nShiftTo], nHighElements * sizeof(Member_t) );
memmove( &NamesBase()[id], &NamesBase()[nShiftTo], nHighElements * sizeof(Name_t) );
memmove( &IsExternalNameBase()[id], &IsExternalNameBase()[nShiftTo], nHighElements * sizeof(IsExternalName_t) );

if ( m_pFastSearch )
{
m_pFastSearch->m_ignore = true;
Expand Down

0 comments on commit 6d45bbc

Please sign in to comment.