diff options
author | Kostya Serebryany <kcc@google.com> | 2016-02-13 17:56:51 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-02-13 17:56:51 +0000 |
commit | 8a5bef0fcfaad1bdab88c5b0206613ebcb075744 (patch) | |
tree | fe31b2599b7705418a3e072d6d1dd038308c9392 /llvm/lib/Fuzzer/FuzzerUtil.cpp | |
parent | e9bf993cee2bd386bcf2b8a1ced27ebf46a6ad92 (diff) | |
download | llvm-8a5bef0fcfaad1bdab88c5b0206613ebcb075744.zip llvm-8a5bef0fcfaad1bdab88c5b0206613ebcb075744.tar.gz llvm-8a5bef0fcfaad1bdab88c5b0206613ebcb075744.tar.bz2 |
[libFuzzer] remove std::vector operations from hot paths, NFC
llvm-svn: 260829
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerUtil.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerUtil.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerUtil.cpp b/llvm/lib/Fuzzer/FuzzerUtil.cpp index 6484d37..81462a4 100644 --- a/llvm/lib/Fuzzer/FuzzerUtil.cpp +++ b/llvm/lib/Fuzzer/FuzzerUtil.cpp @@ -93,9 +93,10 @@ int ExecuteCommand(const std::string &Command) { return system(Command.c_str()); } -bool ToASCII(Unit &U) { +bool ToASCII(uint8_t *Data, size_t Size) { bool Changed = false; - for (auto &X : U) { + for (size_t i = 0; i < Size; i++) { + uint8_t &X = Data[i]; auto NewX = X; NewX &= 127; if (!isspace(NewX) && !isprint(NewX)) |