[llvm-branch-commits] [llvm] [llvm][mustache] Optimize accessor splitting with a single pass (PR #159198)

Erick Velez via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 20 13:54:49 PDT 2025


================
@@ -34,6 +34,32 @@ static bool isContextFalsey(const json::Value *V) {
   return isFalsey(*V);
 }
 
+static void splitAndTrim(StringRef Str, SmallVectorImpl<StringRef> &Tokens) {
+  size_t CurrentPos = 0;
+  while (CurrentPos < Str.size()) {
+    // Find the next delimiter.
+    size_t DelimiterPos = Str.find('.', CurrentPos);
+
+    // If no delimiter is found, process the rest of the string.
+    if (DelimiterPos == StringRef::npos) {
----------------
evelez7 wrote:

nit: can omit the curly braces here

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


More information about the llvm-branch-commits mailing list