[llvm] [llvm-dis][NFC] Avoid unnecessary copies while iterating (PR #109860)
Amr Hesham via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 13:37:19 PDT 2024
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/109860
Avoid unnecessary copies while iterating on input files
>From b13d41cd365456601bd58529498203aee5be1144 Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Tue, 24 Sep 2024 22:36:12 +0200
Subject: [PATCH] [llvm-dis][NFC] Avoid unnecessary copies while iterating
---
llvm/tools/llvm-dis/llvm-dis.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp
index a3a62f042ddbd1..744201289b4a42 100644
--- a/llvm/tools/llvm-dis/llvm-dis.cpp
+++ b/llvm/tools/llvm-dis/llvm-dis.cpp
@@ -203,7 +203,7 @@ int main(int argc, char **argv) {
return 1;
}
- for (std::string InputFilename : InputFilenames) {
+ for (const auto &InputFilename : InputFilenames) {
ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
MemoryBuffer::getFileOrSTDIN(InputFilename);
if (std::error_code EC = BufferOrErr.getError()) {
More information about the llvm-commits
mailing list