forked from OSchip/llvm-project
ImmutableSet: Rename Self to SelfTy to make it more clear it is a type
No functional change intended. llvm-svn: 232317
This commit is contained in:
parent
4ca5191290
commit
fb4898e881
|
@ -652,7 +652,7 @@ public:
|
||||||
Flags=0x3 };
|
Flags=0x3 };
|
||||||
|
|
||||||
typedef ImutAVLTree<ImutInfo> TreeTy;
|
typedef ImutAVLTree<ImutInfo> TreeTy;
|
||||||
typedef ImutAVLTreeGenericIterator<ImutInfo> Self;
|
typedef ImutAVLTreeGenericIterator<ImutInfo> SelfTy;
|
||||||
|
|
||||||
ImutAVLTreeGenericIterator() {}
|
ImutAVLTreeGenericIterator() {}
|
||||||
ImutAVLTreeGenericIterator(const TreeTy *Root) {
|
ImutAVLTreeGenericIterator(const TreeTy *Root) {
|
||||||
|
@ -693,11 +693,11 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Self &x) const { return stack == x.stack; }
|
bool operator==(const SelfTy &x) const { return stack == x.stack; }
|
||||||
|
|
||||||
bool operator!=(const Self &x) const { return !operator==(x); }
|
bool operator!=(const SelfTy &x) const { return !operator==(x); }
|
||||||
|
|
||||||
Self &operator++() {
|
SelfTy &operator++() {
|
||||||
assert(!stack.empty());
|
assert(!stack.empty());
|
||||||
TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
|
TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
|
||||||
assert(Current);
|
assert(Current);
|
||||||
|
@ -723,7 +723,7 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Self &operator--() {
|
SelfTy &operator--() {
|
||||||
assert(!stack.empty());
|
assert(!stack.empty());
|
||||||
TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
|
TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
|
||||||
assert(Current);
|
assert(Current);
|
||||||
|
@ -756,7 +756,7 @@ class ImutAVLTreeInOrderIterator {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef ImutAVLTree<ImutInfo> TreeTy;
|
typedef ImutAVLTree<ImutInfo> TreeTy;
|
||||||
typedef ImutAVLTreeInOrderIterator<ImutInfo> Self;
|
typedef ImutAVLTreeInOrderIterator<ImutInfo> SelfTy;
|
||||||
|
|
||||||
ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) {
|
ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) {
|
||||||
if (Root)
|
if (Root)
|
||||||
|
@ -765,14 +765,16 @@ public:
|
||||||
|
|
||||||
ImutAVLTreeInOrderIterator() : InternalItr() {}
|
ImutAVLTreeInOrderIterator() : InternalItr() {}
|
||||||
|
|
||||||
bool operator==(const Self &x) const { return InternalItr == x.InternalItr; }
|
bool operator==(const SelfTy &x) const {
|
||||||
|
return InternalItr == x.InternalItr;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator!=(const Self &x) const { return !(*this == x); }
|
bool operator!=(const SelfTy &x) const { return !(*this == x); }
|
||||||
|
|
||||||
TreeTy *operator*() const { return *InternalItr; }
|
TreeTy *operator*() const { return *InternalItr; }
|
||||||
TreeTy *operator->() const { return *InternalItr; }
|
TreeTy *operator->() const { return *InternalItr; }
|
||||||
|
|
||||||
Self &operator++() {
|
SelfTy &operator++() {
|
||||||
do ++InternalItr;
|
do ++InternalItr;
|
||||||
while (!InternalItr.atEnd() &&
|
while (!InternalItr.atEnd() &&
|
||||||
InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
|
InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
|
||||||
|
@ -780,7 +782,7 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Self &operator--() {
|
SelfTy &operator--() {
|
||||||
do --InternalItr;
|
do --InternalItr;
|
||||||
while (!InternalItr.atBeginning() &&
|
while (!InternalItr.atBeginning() &&
|
||||||
InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
|
InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
|
||||||
|
|
Loading…
Reference in New Issue