@@ -46,33 +46,33 @@ class SmallSetIterator
46
46
VecIterTy VecIter;
47
47
};
48
48
49
- bool isSmall ;
49
+ bool IsSmall ;
50
50
51
51
public:
52
- SmallSetIterator (SetIterTy SetIter) : SetIter(SetIter), isSmall (false ) {}
52
+ SmallSetIterator (SetIterTy SetIter) : SetIter(SetIter), IsSmall (false ) {}
53
53
54
- SmallSetIterator (VecIterTy VecIter) : VecIter(VecIter), isSmall (true ) {}
54
+ SmallSetIterator (VecIterTy VecIter) : VecIter(VecIter), IsSmall (true ) {}
55
55
56
56
// Spell out destructor, copy/move constructor and assignment operators for
57
57
// MSVC STL, where set<T>::const_iterator is not trivially copy constructible.
58
58
~SmallSetIterator () {
59
- if (isSmall )
59
+ if (IsSmall )
60
60
VecIter.~VecIterTy ();
61
61
else
62
62
SetIter.~SetIterTy ();
63
63
}
64
64
65
- SmallSetIterator (const SmallSetIterator &Other) : isSmall (Other.isSmall ) {
66
- if (isSmall )
65
+ SmallSetIterator (const SmallSetIterator &Other) : IsSmall (Other.IsSmall ) {
66
+ if (IsSmall )
67
67
VecIter = Other.VecIter ;
68
68
else
69
69
// Use placement new, to make sure SetIter is properly constructed, even
70
70
// if it is not trivially copy-able (e.g. in MSVC).
71
71
new (&SetIter) SetIterTy (Other.SetIter );
72
72
}
73
73
74
- SmallSetIterator (SmallSetIterator &&Other) : isSmall (Other.isSmall ) {
75
- if (isSmall )
74
+ SmallSetIterator (SmallSetIterator &&Other) : IsSmall (Other.IsSmall ) {
75
+ if (IsSmall )
76
76
VecIter = std::move (Other.VecIter );
77
77
else
78
78
// Use placement new, to make sure SetIter is properly constructed, even
@@ -83,11 +83,11 @@ class SmallSetIterator
83
83
SmallSetIterator& operator =(const SmallSetIterator& Other) {
84
84
// Call destructor for SetIter, so it gets properly destroyed if it is
85
85
// not trivially destructible in case we are setting VecIter.
86
- if (!isSmall )
86
+ if (!IsSmall )
87
87
SetIter.~SetIterTy ();
88
88
89
- isSmall = Other.isSmall ;
90
- if (isSmall )
89
+ IsSmall = Other.IsSmall ;
90
+ if (IsSmall )
91
91
VecIter = Other.VecIter ;
92
92
else
93
93
new (&SetIter) SetIterTy (Other.SetIter );
@@ -97,34 +97,34 @@ class SmallSetIterator
97
97
SmallSetIterator& operator =(SmallSetIterator&& Other) {
98
98
// Call destructor for SetIter, so it gets properly destroyed if it is
99
99
// not trivially destructible in case we are setting VecIter.
100
- if (!isSmall )
100
+ if (!IsSmall )
101
101
SetIter.~SetIterTy ();
102
102
103
- isSmall = Other.isSmall ;
104
- if (isSmall )
103
+ IsSmall = Other.IsSmall ;
104
+ if (IsSmall )
105
105
VecIter = std::move (Other.VecIter );
106
106
else
107
107
new (&SetIter) SetIterTy (std::move (Other.SetIter ));
108
108
return *this ;
109
109
}
110
110
111
111
bool operator ==(const SmallSetIterator &RHS) const {
112
- if (isSmall != RHS.isSmall )
112
+ if (IsSmall != RHS.IsSmall )
113
113
return false ;
114
- if (isSmall )
114
+ if (IsSmall )
115
115
return VecIter == RHS.VecIter ;
116
116
return SetIter == RHS.SetIter ;
117
117
}
118
118
119
119
SmallSetIterator &operator ++() { // Preincrement
120
- if (isSmall )
121
- VecIter++ ;
120
+ if (IsSmall )
121
+ ++VecIter ;
122
122
else
123
- SetIter++ ;
123
+ ++SetIter ;
124
124
return *this ;
125
125
}
126
126
127
- const T &operator *() const { return isSmall ? *VecIter : *SetIter; }
127
+ const T &operator *() const { return IsSmall ? *VecIter : *SetIter; }
128
128
};
129
129
130
130
// / SmallSet - This maintains a set of unique values, optimizing for the case
@@ -167,9 +167,8 @@ class SmallSet {
167
167
if (isSmall ()) {
168
168
// Since the collection is small, just do a linear search.
169
169
return vfind (V) == Vector.end () ? 0 : 1 ;
170
- } else {
171
- return Set.count (V);
172
170
}
171
+ return Set.count (V);
173
172
}
174
173
175
174
// / insert - Insert an element into the set if it isn't already there.
0 commit comments