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

about possibly swapped memset parameters.  Avoid the warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127170 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2011-03-07 19:38:38 +00:00
parent 42daf912e0
commit e54f64899f

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);
}