From 6c7b64f7f2a05d319fd1b29d68f5d39ebaa11ca8 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Fri, 10 Mar 2023 09:40:22 +0100 Subject: [PATCH] Use memcmp() in value_is_equal() --- src/emu/value.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/emu/value.h b/src/emu/value.h index 595fba7..330c4de 100644 --- a/src/emu/value.h +++ b/src/emu/value.h @@ -27,17 +27,7 @@ struct value { static inline int value_is_equal(struct value *a, struct value *b) { - if (a->type != b->type) - return 0; - - if (a->type == VALUE_INT64 && a->i == b->i) - return 1; - else if (a->type == VALUE_DOUBLE && a->d == b->d) - return 1; - else if (a->type == VALUE_NULL && b->type == VALUE_NULL) - return 1; - else - return 0; + return memcmp(a, b, sizeof(struct value)) == 0; } static inline struct value