From 4c78b7882506957febf4318978d31b5aaae7cced Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Fri, 16 Aug 2019 14:27:35 +0000 Subject: [lldb][NFC] Allow for-ranges on StringList llvm-svn: 369113 --- lldb/source/Commands/CommandObjectCommands.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index e7f99e2316c..65fc8869edf 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -966,11 +966,9 @@ protected: if (m_regex_cmd_up) { StringList lines; if (lines.SplitIntoLines(data)) { - const size_t num_lines = lines.GetSize(); bool check_only = false; - for (size_t i = 0; i < num_lines; ++i) { - llvm::StringRef bytes_strref(lines[i]); - Status error = AppendRegexSubstitution(bytes_strref, check_only); + for (const std::string &line : lines) { + Status error = AppendRegexSubstitution(line, check_only); if (error.Fail()) { if (!GetDebugger().GetCommandInterpreter().GetBatchCommandMode()) { StreamSP out_stream = GetDebugger().GetAsyncOutputStream(); -- cgit v1.2.3