MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / resize

Method resize

extern/re2/re2/sparse_set.h:196–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194// Invalidates all iterators.
195template<typename Value>
196void SparseSetT<Value>::resize(int new_max_size) {
197 DebugCheckInvariants();
198 if (new_max_size > max_size()) {
199 const int old_max_size = max_size();
200
201 // Construct these first for exception safety.
202 PODArray<int> a(new_max_size);
203 PODArray<int> b(new_max_size);
204
205 std::copy_n(sparse_.data(), old_max_size, a.data());
206 std::copy_n(dense_.data(), old_max_size, b.data());
207
208 sparse_ = std::move(a);
209 dense_ = std::move(b);
210
211 MaybeInitializeMemory(old_max_size, new_max_size);
212 }
213 if (size_ > new_max_size)
214 size_ = new_max_size;
215 DebugCheckInvariants();
216}
217
218// Check whether index i is in the set.
219template<typename Value>

Callers 11

SetFactorialSequenceFunction · 0.45
SetBernoulliNumbersMoreFunction · 0.45
SetBernoulliNumbersFunction · 0.45
EqualMethod · 0.45
ConvertRunesToBytesFunction · 0.45
NFAMethod · 0.45
KeepNodeMethod · 0.45
AssignUniqueIdsMethod · 0.45
RandomDigitsMethod · 0.45
TestRecursionFunction · 0.45
RandomTextFunction · 0.45

Calls 3

copy_nFunction · 0.85
moveFunction · 0.50
dataMethod · 0.45

Tested by 1

TestRecursionFunction · 0.36