@@ -133,7 +133,7 @@ class SparseSet {
133
133
struct Deleter {
134
134
void operator ()(SparseT *S) { free (S); }
135
135
};
136
- std::unique_ptr<SparseT, Deleter> Sparse;
136
+ std::unique_ptr<SparseT[] , Deleter> Sparse;
137
137
138
138
unsigned Universe = 0 ;
139
139
KeyFunctorT KeyIndexOf;
@@ -209,7 +209,7 @@ class SparseSet {
209
209
assert (Idx < Universe && " Key out of range" );
210
210
assert (Sparse != nullptr && " Invalid sparse type" );
211
211
const unsigned Stride = std::numeric_limits<SparseT>::max () + 1u ;
212
- for (unsigned i = Sparse. get () [Idx], e = size (); i < e; i += Stride) {
212
+ for (unsigned i = Sparse[Idx], e = size (); i < e; i += Stride) {
213
213
const unsigned FoundIdx = ValIndexOf (Dense[i]);
214
214
assert (FoundIdx < Universe && " Invalid key in set. Did object mutate?" );
215
215
if (Idx == FoundIdx)
@@ -259,7 +259,7 @@ class SparseSet {
259
259
iterator I = findIndex (Idx);
260
260
if (I != end ())
261
261
return std::make_pair (I, false );
262
- Sparse. get () [Idx] = size ();
262
+ Sparse[Idx] = size ();
263
263
Dense.push_back (Val);
264
264
return std::make_pair (end () - 1 , true );
265
265
}
@@ -296,7 +296,7 @@ class SparseSet {
296
296
*I = Dense.back ();
297
297
unsigned BackIdx = ValIndexOf (Dense.back ());
298
298
assert (BackIdx < Universe && " Invalid key in set. Did object mutate?" );
299
- Sparse. get () [BackIdx] = I - begin ();
299
+ Sparse[BackIdx] = I - begin ();
300
300
}
301
301
// This depends on SmallVector::pop_back() not invalidating iterators.
302
302
// std::vector::pop_back() doesn't give that guarantee.
0 commit comments