| 38 | } |
| 39 | |
| 40 | void UArray_replace_with_(UArray *self, const UArray *a1, const UArray *a2) { |
| 41 | long i; |
| 42 | size_t start = 0; |
| 43 | UArray visible = UArray_stackRange(self, start, self->size); |
| 44 | |
| 45 | if (UArray_size(a1) == 0) |
| 46 | return; |
| 47 | |
| 48 | while ((i = UArray_find_(&visible, a1)) != -1) { |
| 49 | size_t index = start + i; |
| 50 | UArray_removeRange(self, index, a1->size); |
| 51 | UArray_at_putAll_(self, index, a2); |
| 52 | start = index + a2->size; |
| 53 | visible = UArray_stackRange(self, start, self->size - start); |
| 54 | } |
| 55 | UArray_changed(self); |
| 56 | } |
| 57 | |
| 58 | BASEKIT_API void UArray_replaceCString_withCString_(UArray *self, |
| 59 | const char *s1, |
no test coverage detected