Skip to content

Commit da62f5f

Browse files
committed
[lldb][DataFormatter][NFC] std::map: Add comments and other minor cleanups
1 parent aa0851a commit da62f5f

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,10 @@ class MapEntry {
8080

8181
class MapIterator {
8282
public:
83-
MapIterator() = default;
84-
MapIterator(MapEntry entry, size_t depth = 0)
85-
: m_entry(std::move(entry)), m_max_depth(depth), m_error(false) {}
86-
MapIterator(ValueObjectSP entry, size_t depth = 0)
87-
: m_entry(std::move(entry)), m_max_depth(depth), m_error(false) {}
88-
MapIterator(const MapIterator &rhs)
89-
: m_entry(rhs.m_entry), m_max_depth(rhs.m_max_depth), m_error(false) {}
9083
MapIterator(ValueObject *entry, size_t depth = 0)
9184
: m_entry(entry), m_max_depth(depth), m_error(false) {}
9285

93-
MapIterator &operator=(const MapIterator &) = default;
86+
MapIterator() = default;
9487

9588
ValueObjectSP value() { return m_entry.GetEntry(); }
9689

@@ -108,7 +101,9 @@ class MapIterator {
108101
return m_entry.GetEntry();
109102
}
110103

111-
protected:
104+
private:
105+
/// Mimicks libc++'s __tree_next algorithm, which libc++ uses
106+
/// in its __tree_iteartor::operator++.
112107
void next() {
113108
if (m_entry.null())
114109
return;
@@ -133,7 +128,7 @@ class MapIterator {
133128
m_entry = MapEntry(m_entry.parent());
134129
}
135130

136-
private:
131+
/// Mimicks libc++'s __tree_min algorithm.
137132
MapEntry tree_min(MapEntry x) {
138133
if (x.null())
139134
return MapEntry();

0 commit comments

Comments
 (0)