[llvm] [llvm-strings] Use small buffer instead of reading whole file (PR #163073)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 01:31:51 PDT 2026


================
@@ -129,40 +137,65 @@ static void strings(raw_ostream &OS, StringRef FileName,
              << errorToErrorCode(ReadBytesOrErr.takeError()).message() << '\n';
       return;
     }
-    std::size_t CurSize = *ReadBytesOrErr;
-    if (CurSize == 0)
+    std::size_t ChunkSize = *ReadBytesOrErr;
+    if (ChunkSize == 0)
       break;
 
-    std::size_t I = 0;
-    while (I != CurSize) {
+    const char *const B = Buffer.data();
----------------
jh7370 wrote:

Nit: let's avoid single letter variables.

https://github.com/llvm/llvm-project/pull/163073


More information about the llvm-commits mailing list