| 293 | // find |
| 294 | |
| 295 | BASEKIT_API int UArray_beginsWith_(UArray *self, const UArray *other) { |
| 296 | size_t msize = self->size; |
| 297 | size_t osize = other->size; |
| 298 | |
| 299 | if (msize >= osize) { |
| 300 | /* A common case seems to be comparing against a single byte, which |
| 301 | * happens all of the place internally (not sure why yet, but it would |
| 302 | * be good to investigate this)*/ |
| 303 | if (osize == 1) { |
| 304 | return (*(self->data) == *(other->data)); |
| 305 | } else if (memcmp(self->data, other->data, osize) == 0) { |
| 306 | return 1; |
| 307 | } |
| 308 | return 0; |
| 309 | } |
| 310 | return 0; |
| 311 | } |
| 312 | |
| 313 | BASEKIT_API int UArray_endsWith_(UArray *self, const UArray *other) { |
| 314 | if (self->size >= other->size) { |
no outgoing calls
no test coverage detected