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

Function UArray_clipBeforeEndOf_

libs/basekit/source/UArray_string.c:106–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106BASEKIT_API int UArray_clipBeforeEndOf_(UArray *self, const UArray *other) {
107 long index = UArray_find_(self, other);
108 /*
109 printf("UArray_find_('%s', '%s')\n", UArray_bytes(self),
110 UArray_bytes(other)); printf("find index = %i\n", index); printf("prefix
111 sizeInBytes = %i\n", UArray_sizeInBytes(other)); printf("prefix size =
112 %i\n", UArray_size(other));
113 */
114 if (index > -1 && other->size) {
115 // printf("UArray_removeRange(0, %i)\n", index + other->size - 1);
116 UArray_removeRange(self, 0, index + other->size);
117 // printf("result = '%s'\n", UArray_bytes(self));
118 return 1;
119 }
120
121 return 0;
122}
123
124BASEKIT_API int UArray_clipAfter_(UArray *self, const UArray *other) {
125 long index = UArray_find_(self, other);

Callers 1

IoSeq_mutable.cFile · 0.85

Calls 2

UArray_find_Function · 0.85
UArray_removeRangeFunction · 0.85

Tested by

no test coverage detected