| 146 | // strip |
| 147 | |
| 148 | void 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 | |
| 168 | void UArray_rstrip_(UArray *self, const UArray *other) { |
| 169 | size_t index = 0; // initial value is only needed when FOREACHes don't work |
no test coverage detected