Often GCC can see that NumBuckets is zero here, resulting in a warning

about possibly swapped memset parameters.  Avoid the warning.

llvm-svn: 127170
This commit is contained in:
Duncan Sands 2011-03-07 19:38:38 +00:00
parent e9fdc06fec
commit e5d7369e1e
1 changed files with 2 additions and 1 deletions

View File

@ -72,7 +72,8 @@ public:
P->first.~KeyT();
}
#ifndef NDEBUG
memset(Buckets, 0x5a, sizeof(BucketT)*NumBuckets);
if (NumBuckets)
memset(Buckets, 0x5a, sizeof(BucketT)*NumBuckets);
#endif
operator delete(Buckets);
}