1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[libFuzzer] minor speed improvement

llvm-svn: 278856
This commit is contained in:
Kostya Serebryany 2016-08-16 21:28:05 +00:00
parent 8384a7726b
commit 53ab688ab6

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;