[compiler-rt] 85236e6 - [NFC][sanitizer] Minor change: eliminate loop
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 7 10:33:17 PDT 2022
Author: theidexisted
Date: 2022-07-07T10:33:08-07:00
New Revision: 85236e6f3b1bd3b2b61372a56bd740600d2c5c62
URL: https://github.com/llvm/llvm-project/commit/85236e6f3b1bd3b2b61372a56bd740600d2c5c62
DIFF: https://github.com/llvm/llvm-project/commit/85236e6f3b1bd3b2b61372a56bd740600d2c5c62.diff
LOG: [NFC][sanitizer] Minor change: eliminate loop
Reviewed By: #sanitizers, fmayer, vitalybuka
Differential Revision: https://reviews.llvm.org/D128873
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_vector.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_vector.h b/compiler-rt/lib/sanitizer_common/sanitizer_vector.h
index 31216f3ec3a6..79ff275660d3 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_vector.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_vector.h
@@ -83,8 +83,8 @@ class Vector {
}
EnsureSize(size);
if (old_size < size) {
- for (uptr i = old_size; i < size; i++)
- internal_memset(&begin_[i], 0, sizeof(begin_[i]));
+ internal_memset(&begin_[old_size], 0,
+ sizeof(begin_[old_size]) * (size - old_size));
}
}
More information about the llvm-commits
mailing list