[libFuzzer] minor speed improvement

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278856 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kostya Serebryany 2016-08-16 21:28:05 +00:00
parent 269bd6538c
commit f61ef6cf72

View File

@ -26,7 +26,7 @@ struct ValueBitMap {
// Computed a hash function of Value and sets the corresponding bit.
void AddValue(uintptr_t Value) {
uintptr_t Idx = Value % kMapSizeInBits;
uintptr_t Idx = Value < kMapSizeInBits ? Value : Value % kMapSizeInBits;
uintptr_t WordIdx = Idx / kBitsInWord;
uintptr_t BitIdx = Idx % kBitsInWord;
Map[WordIdx] |= 1UL << BitIdx;