[Lldb-commits] [lldb] [lldb] Use StringRef in formatters::ExtractIndexFromString (PR #229930)

via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 8 12:53:48 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- lldb/unittests/DataFormatter/FormattersHelpersTests.cpp lldb/include/lldb/DataFormatters/FormattersHelpers.h lldb/source/DataFormatters/FormattersHelpers.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/unittests/DataFormatter/FormattersHelpersTests.cpp b/lldb/unittests/DataFormatter/FormattersHelpersTests.cpp
index 3c47897fe..32b188b1c 100644
--- a/lldb/unittests/DataFormatter/FormattersHelpersTests.cpp
+++ b/lldb/unittests/DataFormatter/FormattersHelpersTests.cpp
@@ -19,7 +19,8 @@ TEST(FormattersHelpersTests, ExtractIndexFromString) {
   EXPECT_EQ(ExtractIndexFromString("[0]"), std::optional<size_t>(0));
   EXPECT_EQ(ExtractIndexFromString("[1]"), std::optional<size_t>(1));
   EXPECT_EQ(ExtractIndexFromString("[42]"), std::optional<size_t>(42));
-  EXPECT_EQ(ExtractIndexFromString("[1234567]"), std::optional<size_t>(1234567));
+  EXPECT_EQ(ExtractIndexFromString("[1234567]"),
+            std::optional<size_t>(1234567));
 
   // The base is auto-detected, so hex and octal are accepted.
   EXPECT_EQ(ExtractIndexFromString("[0x10]"), std::optional<size_t>(16));

``````````

</details>


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


More information about the lldb-commits mailing list