Update array

This commit is contained in:
2022-06-03 14:10:38 +03:00
parent ee6f3d3715
commit 6aca959de7
2 changed files with 8 additions and 21 deletions
+7 -19
View File
@@ -25,27 +25,15 @@ ssize_t array_find(const arr_t* x, const void* v, vtype vt) {
assert(!is_null(x->mem));
if (x->type != vt) {
do {
++index;
c = vtype_compare(p, x->type, v, vt);
do {
++index;
c = vtype_compare(p, x->type, v, vt);
if (c == 0)
return index;
if (c == 0)
return index;
p += vtype_size(x->type);
} while (p < e);
} else {
do {
++index;
c = vtype_compare_eq(p, v, vt);
if (c == 0)
return index;
p += vtype_size(x->type);
} while (p < e);
}
p += vtype_size(x->type);
} while (p < e);
return -1;
}