[Lldb-commits] [PATCH] D120101: [lldb] Fix (unintentional) recursion in CommandObjectRegexCommand

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 18 00:48:57 PST 2022


labath added a comment.

Wouldn't want to miss a good bikeshed. Logarithms are cool, but I think something like this (untested) snippet would be simpler

  Input.split(Parts, '%');
  Result << Parts[0];
  for (llvm::StringRef Part : drop_begin(Parts)) {
    if (!Part.consumeInteger(10, Idx) && Idx < Replacements.size())
      Result << Replacements[Idx];
    else
      Result << '%';
    Result << Part;
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120101/new/

https://reviews.llvm.org/D120101



More information about the lldb-commits mailing list