MCPcopy Create free account
hub / github.com/IoLanguage/io / UArray_reverse

Function UArray_reverse

libs/basekit/source/UArray_string.c:210–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208// reverse
209
210BASEKIT_API void UArray_reverse(UArray *self) {
211 long i = 0;
212 long j = self->size - 1;
213 UArrayValueUnion b;
214 size_t itemSize = self->itemSize;
215 uint8_t *data = self->data;
216
217 while (j > i) {
218 void *ip = data + i * itemSize;
219 void *jp = data + j * itemSize;
220
221 memcpy(&b, ip, itemSize);
222 memcpy(ip, jp, itemSize);
223 memcpy(jp, &b, itemSize);
224
225 j--;
226 i++;
227 }
228
229 UArray_changed(self);
230}
231
232/*
233#define UARRAY_MATCHPREFIXLENGTH_TYPES(OP2, TYPE1, self, TYPE2, other)\

Callers 1

IoSeq_mutable.cFile · 0.85

Calls 1

UArray_changedFunction · 0.85

Tested by

no test coverage detected