diff options
author | Kostya Serebryany <kcc@google.com> | 2016-08-16 21:28:05 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-08-16 21:28:05 +0000 |
commit | 3044390af140b3c7a86d75aaa3b0ca7ee03432bf (patch) | |
tree | 80495b2da0c5db63535241cc4d9277c23ce27380 /llvm/lib/Fuzzer | |
parent | b9aa67bfcfb097d7bd3f21fb94be86bde331c676 (diff) | |
download | bcm5719-llvm-3044390af140b3c7a86d75aaa3b0ca7ee03432bf.tar.gz bcm5719-llvm-3044390af140b3c7a86d75aaa3b0ca7ee03432bf.zip |
[libFuzzer] minor speed improvement
llvm-svn: 278856
Diffstat (limited to 'llvm/lib/Fuzzer')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerValueBitMap.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerValueBitMap.h b/llvm/lib/Fuzzer/FuzzerValueBitMap.h index 493afc574cc..65659f21349 100644 --- a/llvm/lib/Fuzzer/FuzzerValueBitMap.h +++ b/llvm/lib/Fuzzer/FuzzerValueBitMap.h @@ -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; |