MCPcopy Create free account
hub / github.com/codr7/hacktical-c / hc_vector_delete

Function hc_vector_delete

vector/vector.c:87–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87bool hc_vector_delete(struct hc_vector *v, const size_t i, const size_t n) {
88 const size_t m = i+n;
89 assert(m <= v->length);
90
91 if (m < v->length) {
92 uint8_t *const p = hc_vector_get(v, i);
93 memmove(p, p + n*v->item_size, i + (v->length-n) * v->item_size);
94 }
95
96 v->length -= n;
97 v->end -= n*v->item_size;
98 return true;
99}

Callers 2

memo_acquireFunction · 0.85
vector_testsFunction · 0.85

Calls 1

hc_vector_getFunction · 0.85

Tested by 1

vector_testsFunction · 0.68