@@ -133,7 +133,7 @@ class SparseSet {
133133 struct Deleter {
134134 void operator ()(SparseT *S) { free (S); }
135135 };
136- std::unique_ptr<SparseT, Deleter> Sparse;
136+ std::unique_ptr<SparseT[] , Deleter> Sparse;
137137
138138 unsigned Universe = 0 ;
139139 KeyFunctorT KeyIndexOf;
@@ -209,7 +209,7 @@ class SparseSet {
209209 assert (Idx < Universe && " Key out of range" );
210210 assert (Sparse != nullptr && " Invalid sparse type" );
211211 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) {
213213 const unsigned FoundIdx = ValIndexOf (Dense[i]);
214214 assert (FoundIdx < Universe && " Invalid key in set. Did object mutate?" );
215215 if (Idx == FoundIdx)
@@ -259,7 +259,7 @@ class SparseSet {
259259 iterator I = findIndex (Idx);
260260 if (I != end ())
261261 return std::make_pair (I, false );
262- Sparse. get () [Idx] = size ();
262+ Sparse[Idx] = size ();
263263 Dense.push_back (Val);
264264 return std::make_pair (end () - 1 , true );
265265 }
@@ -296,7 +296,7 @@ class SparseSet {
296296 *I = Dense.back ();
297297 unsigned BackIdx = ValIndexOf (Dense.back ());
298298 assert (BackIdx < Universe && " Invalid key in set. Did object mutate?" );
299- Sparse. get () [BackIdx] = I - begin ();
299+ Sparse[BackIdx] = I - begin ();
300300 }
301301 // This depends on SmallVector::pop_back() not invalidating iterators.
302302 // std::vector::pop_back() doesn't give that guarantee.
0 commit comments