MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / add

Method add

source/util/karray.h:43–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42 }
43 void add(const T& t) {
44 if (this->_size==this->_reserved) {
45 if (this->_reserved)
46 this->_reserved*=2;
47 else
48 this->_reserved = 8;
49 T* tmp = new T[this->_reserved];
50 if (this->_data) {
51 for (U32 i=0;i<this->_size;i++) {
52 tmp[i] = this->_data[i];
53 }
54 delete[] this->_data;
55 }
56 this->_data = tmp;
57 }
58 this->_data[this->_size] = t;
59 this->_size++;
60 }
61 void removeAt(int idx) {
62#ifdef _DEBUG
63 if (idx>=this->size())

Callers 1

addCode_nolockMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected