[llvm-branch-commits] [llvm] [llvm][mustache] Avoid extra copy for json strings (PR #159195)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 29 10:39:58 PDT 2025


https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/159195

>From 8b1efc31349d27adf363352a3b6cd9b851015295 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Mon, 15 Sep 2025 19:54:34 -0700
Subject: [PATCH] [llvm][mustache] Avoid extra copy for json strings

---
 llvm/lib/Support/Mustache.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/lib/Support/Mustache.cpp b/llvm/lib/Support/Mustache.cpp
index 1f6acc9e427e0..08cddec9bec6d 100644
--- a/llvm/lib/Support/Mustache.cpp
+++ b/llvm/lib/Support/Mustache.cpp
@@ -683,8 +683,7 @@ static void toMustacheString(const json::Value &Data, raw_ostream &OS) {
     return;
   }
   case json::Value::String: {
-    auto Str = *Data.getAsString();
-    OS << Str.str();
+    OS << *Data.getAsString();
     return;
   }
 



More information about the llvm-branch-commits mailing list