MCPcopy Create free account
hub / github.com/defold/defold / Add

Method Add

engine/dlib/src/dlib/set.h:329–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327
328template <typename T>
329bool dmSet<T>::Add(const T& value)
330{
331 T* end = m_Values + m_Size;
332 T* p = LowerBound(m_Values, end, value);
333 if (p < end && (*p) == value)
334 {
335 return false; // Already existed
336 }
337
338 assert(!Full());
339
340 uint32_t count = end - p;
341 memmove(p+1, p, count * sizeof(T));
342 (*p) = value;
343 m_Size++;
344 return true;
345}
346
347template <typename T>
348bool dmSet<T>::Remove(const T& value)

Callers 3

AllocateTimerFunction · 0.45
TESTFunction · 0.45
GenerateGlyphsFunction · 0.45

Calls 1

assertFunction · 0.50

Tested by 1

TESTFunction · 0.36