- Fixed: TMap::DelKey failed if the key's main position was nil, because it tried checking

for it at the "next" position, which is an invalid pointer in that case.

SVN r2236 (trunk)
This commit is contained in:
Randy Heit 2010-03-22 21:09:33 +00:00
parent 41df8242c1
commit d1f9b94743

View file

@ -730,7 +730,11 @@ protected:
Node *mp = MainPosition(key), **mpp;
HashTraits Traits;
if (!mp->IsNil() && !Traits.Compare(mp->Pair.Key, key)) /* the key is in its main position */
if (mp->IsNil())
{
/* the key is definitely not present, because there is nothing at its main position */
}
else if (!Traits.Compare(mp->Pair.Key, key)) /* the key is in its main position */
{
if (mp->Next != NULL) /* move next node to its main position */
{