Update array
This commit is contained in:
+7
-19
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user