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

Function UArray_rstrip_

libs/basekit/source/UArray_string.c:168–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void UArray_rstrip_(UArray *self, const UArray *other) {
169 size_t index = 0; // initial value is only needed when FOREACHes don't work
170
171 if (UArray_isFloatType(self)) {
172 UARRAY_RFOREACH(
173 self, i, v, index = i; if (!UArray_containsDouble_(other, v)) {
174 index++;
175 break;
176 })
177 } else {
178 UARRAY_RFOREACH(
179 self, i, v, index = i; if (!UArray_containsLong_(other, v)) {
180 index++;
181 break;
182 })
183 }
184
185 UArray_removeRange(self, index, self->size);
186}
187
188BASEKIT_API void UArray_strip_(UArray *self, const UArray *other) {
189 UArray_lstrip_(self, other);

Callers 2

UArray_strip_Function · 0.85
IoSeq_mutable.cFile · 0.85

Calls 4

UArray_isFloatTypeFunction · 0.85
UArray_containsDouble_Function · 0.85
UArray_containsLong_Function · 0.85
UArray_removeRangeFunction · 0.85

Tested by

no test coverage detected