MCPcopy Create free account
hub / github.com/DFHack/dfhack / insert

Method insert

library/include/BitArray.h:275–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273 memmove(ptr, ptr+1, sizeof(T)*(m_size - (ptr - m_data))); m_size--;
274 }
275 void insert(T *ptr, const T &item) {
276 int idx = ptr - m_data;
277 resize(m_size+1);
278 memmove(m_data + idx + 1, m_data + idx, sizeof(T)*(m_size - idx - 1));
279 m_data[idx] = item;
280 }
281 };
282
283 template <typename L, typename I>

Callers 1

vector_insert_atFunction · 0.45

Calls 1

resizeFunction · 0.70

Tested by

no test coverage detected