This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9ed72d4d4d50: [lldb][NFCI] Replace bespoke iterator check 
with std::next (authored by bulbazord).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159150

Files:
  lldb/source/Utility/StructuredData.cpp


Index: lldb/source/Utility/StructuredData.cpp
===================================================================
--- lldb/source/Utility/StructuredData.cpp
+++ lldb/source/Utility/StructuredData.cpp
@@ -228,9 +228,9 @@
 
 void StructuredData::Dictionary::GetDescription(lldb_private::Stream &s) const 
{
   size_t indentation_level = s.GetIndentLevel();
-  for (const auto &pair : m_dict) {
+  for (auto iter = m_dict.begin(); iter != m_dict.end(); iter++) {
     // Sanitize.
-    if (pair.first.IsNull() || pair.first.IsEmpty() || !pair.second)
+    if (iter->first.IsNull() || iter->first.IsEmpty() || !iter->second)
       continue;
 
     // Reset original indentation level.
@@ -238,11 +238,11 @@
     s.Indent();
 
     // Print key.
-    s.Printf("%s:", pair.first.AsCString());
+    s.Printf("%s:", iter->first.AsCString());
 
     // Return to new line and increase indentation if value is record type.
     // Otherwise add spacing.
-    bool should_indent = IsRecordType(pair.second);
+    bool should_indent = IsRecordType(iter->second);
     if (should_indent) {
       s.EOL();
       s.IndentMore();
@@ -251,8 +251,8 @@
     }
 
     // Print value and new line if now last pair.
-    pair.second->GetDescription(s);
-    if (pair != *(--m_dict.end()))
+    iter->second->GetDescription(s);
+    if (std::next(iter) != m_dict.end())
       s.EOL();
 
     // Reset indentation level if it was incremented previously.


Index: lldb/source/Utility/StructuredData.cpp
===================================================================
--- lldb/source/Utility/StructuredData.cpp
+++ lldb/source/Utility/StructuredData.cpp
@@ -228,9 +228,9 @@
 
 void StructuredData::Dictionary::GetDescription(lldb_private::Stream &s) const {
   size_t indentation_level = s.GetIndentLevel();
-  for (const auto &pair : m_dict) {
+  for (auto iter = m_dict.begin(); iter != m_dict.end(); iter++) {
     // Sanitize.
-    if (pair.first.IsNull() || pair.first.IsEmpty() || !pair.second)
+    if (iter->first.IsNull() || iter->first.IsEmpty() || !iter->second)
       continue;
 
     // Reset original indentation level.
@@ -238,11 +238,11 @@
     s.Indent();
 
     // Print key.
-    s.Printf("%s:", pair.first.AsCString());
+    s.Printf("%s:", iter->first.AsCString());
 
     // Return to new line and increase indentation if value is record type.
     // Otherwise add spacing.
-    bool should_indent = IsRecordType(pair.second);
+    bool should_indent = IsRecordType(iter->second);
     if (should_indent) {
       s.EOL();
       s.IndentMore();
@@ -251,8 +251,8 @@
     }
 
     // Print value and new line if now last pair.
-    pair.second->GetDescription(s);
-    if (pair != *(--m_dict.end()))
+    iter->second->GetDescription(s);
+    if (std::next(iter) != m_dict.end())
       s.EOL();
 
     // Reset indentation level if it was incremented previously.
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits]... Alex Langford via Phabricator via lldb-commits
    • [Lldb-com... Jonas Devlieghere via Phabricator via lldb-commits
    • [Lldb-com... Felipe de Azevedo Piovezan via Phabricator via lldb-commits
    • [Lldb-com... Alex Langford via Phabricator via lldb-commits

Reply via email to