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

Function UArray_swapIndex_withIndex_

libs/basekit/source/UArray_string.c:195–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193// swap
194
195BASEKIT_API void UArray_swapIndex_withIndex_(UArray *self, size_t i, size_t j) {
196 size_t itemSize = self->itemSize;
197 uint8_t *data = self->data;
198 void *ip = data + i * itemSize;
199 void *jp = data + j * itemSize;
200 UArrayValueUnion b;
201
202 memcpy(&b, ip, sizeof(UArray));
203 memcpy(ip, jp, sizeof(UArray));
204 memcpy(jp, &b, sizeof(UArray));
205 UArray_changed(self);
206}
207
208// reverse
209

Callers

nothing calls this directly

Calls 1

UArray_changedFunction · 0.85

Tested by

no test coverage detected