[compiler-rt] cdfcf1a - [libfuzzer] avoid unneccessary auto-copy

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 19:06:46 PDT 2023


Author: Wu, Yingcong
Date: 2023-04-26T19:06:40-07:00
New Revision: cdfcf1aa38a4288475b1ed974ef46710b5da333d

URL: https://github.com/llvm/llvm-project/commit/cdfcf1aa38a4288475b1ed974ef46710b5da333d
DIFF: https://github.com/llvm/llvm-project/commit/cdfcf1aa38a4288475b1ed974ef46710b5da333d.diff

LOG: [libfuzzer] avoid unneccessary auto-copy

Avoid an unneccessary auto-copy

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D148902

Added: 
    

Modified: 
    compiler-rt/lib/fuzzer/FuzzerCorpus.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/fuzzer/FuzzerCorpus.h b/compiler-rt/lib/fuzzer/FuzzerCorpus.h
index e01891e18fe31..912082be8fbae 100644
--- a/compiler-rt/lib/fuzzer/FuzzerCorpus.h
+++ b/compiler-rt/lib/fuzzer/FuzzerCorpus.h
@@ -77,7 +77,7 @@ struct InputInfo {
     SumIncidence = 0.0;
 
     // Apply add-one smoothing to locally discovered features.
-    for (auto F : FeatureFreqs) {
+    for (const auto &F : FeatureFreqs) {
       double LocalIncidence = F.second + 1;
       Energy -= LocalIncidence * log(LocalIncidence);
       SumIncidence += LocalIncidence;


        


More information about the llvm-commits mailing list