summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-06-08 13:00:37 +0200
committerJo-Philipp Wich <jo@mein.io>2021-06-08 13:54:50 +0200
commit4e410c3411f73da6d27b28ce057159cda7b50b66 (patch)
tree6fd8ee299fb46c678acce2ce36f7d76fb91a4dbc /lib.c
parentce6081dbbd588fb111754f3c2c1c93d2421c6ee6 (diff)
treewide: let uc_cmp() use instruction instead of token numbers
This allows us to drop some token->instruction mapping case switches in the VM. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib.c b/lib.c
index 8044fde..23e9ac2 100644
--- a/lib.c
+++ b/lib.c
@@ -339,7 +339,7 @@ uc_index(uc_vm *vm, size_t nargs, bool right)
switch (ucv_type(stack)) {
case UC_ARRAY:
for (arridx = 0, len = ucv_array_length(stack); arridx < len; arridx++) {
- if (uc_cmp(TK_EQ, ucv_array_get(stack, arridx), needle)) {
+ if (uc_cmp(I_EQ, ucv_array_get(stack, arridx), needle)) {
ret = (ssize_t)arridx;
if (!right)
@@ -2600,13 +2600,13 @@ uc_min_max(uc_vm *vm, size_t nargs, int cmp)
static uc_value_t *
uc_min(uc_vm *vm, size_t nargs)
{
- return uc_min_max(vm, nargs, TK_LT);
+ return uc_min_max(vm, nargs, I_LT);
}
static uc_value_t *
uc_max(uc_vm *vm, size_t nargs)
{
- return uc_min_max(vm, nargs, TK_GT);
+ return uc_min_max(vm, nargs, I_GT);
}