[llvm] b0d252d - [llvm][mustache] Avoid extra copy for json strings (#159195)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 9 11:27:16 PDT 2025


Author: Paul Kirth
Date: 2025-10-09T18:27:11Z
New Revision: b0d252da3cbc1c6e5747b618c301881da663de86

URL: https://github.com/llvm/llvm-project/commit/b0d252da3cbc1c6e5747b618c301881da663de86
DIFF: https://github.com/llvm/llvm-project/commit/b0d252da3cbc1c6e5747b618c301881da663de86.diff

LOG: [llvm][mustache] Avoid extra copy for json strings (#159195)

Added: 
    

Modified: 
    llvm/lib/Support/Mustache.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/Mustache.cpp b/llvm/lib/Support/Mustache.cpp
index 6fe1eaf4ce09a..708e79d39cd21 100644
--- a/llvm/lib/Support/Mustache.cpp
+++ b/llvm/lib/Support/Mustache.cpp
@@ -698,8 +698,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-commits mailing list