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

Function UArray_beginsWith_

libs/basekit/source/UArray_string.c:295–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293// find
294
295BASEKIT_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
313BASEKIT_API int UArray_endsWith_(UArray *self, const UArray *other) {
314 if (self->size >= other->size) {

Callers 4

UArray_split_Function · 0.85
UArray_unquoteFunction · 0.85
IoSeq_immutable.cFile · 0.85
IoSeq_mutable.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected