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

Function UArray_lstrip_

libs/basekit/source/UArray_string.c:148–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146// strip
147
148void UArray_lstrip_(UArray *self, const UArray *other) {
149 size_t amount = 0;
150
151 if (UArray_isFloatType(self)) {
152 UARRAY_FOREACH(
153 self, i, v, amount = i + 1; if (!UArray_containsDouble_(other, v)) {
154 amount--;
155 break;
156 })
157 } else {
158 UARRAY_FOREACH(
159 self, i, v, amount = i + 1; if (!UArray_containsLong_(other, v)) {
160 amount--;
161 break;
162 })
163 }
164
165 UArray_removeRange(self, 0, amount);
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

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