MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / bulk_push_back

Method bulk_push_back

TombEngine/Specific/fast_vector.h:366–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364
365template <class T>
366void fast_vector<T>::bulk_push_back(std::vector<T>& source, int startIndex, int count)
367{
368 if (m_size + count >= m_capacity)
369 {
370 reserve(m_capacity * fast_vector::grow_factor + 1);
371 }
372
373 if constexpr (std::is_trivial_v<T>)
374 {
375 T* sourceData = source.data();
376 memcpy(m_data + m_size, sourceData + startIndex, sizeof(T) * count);
377 m_size += count;
378 }
379 else
380 {
381 for (int i = 0; i < count; i++)
382 {
383 new (m_data + m_size) T(source[i]);
384 m_size++;
385 }
386 }
387}
388
389template <class T>
390void fast_vector<T>::bulk_push_back(T* source, int startIndex, int count)

Callers 1

DrawSortedFacesMethod · 0.80

Calls 2

reserveFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected