From 2e9e7a176f80725642f7e885eeddc122419c3427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Isalski?= Date: Wed, 16 Sep 2026 20:19:47 +0200 Subject: [PATCH] Added handling item actually having hash 0 --- src/hashset.asm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hashset.asm b/src/hashset.asm index e1293ed..93d2be0 100644 --- a/src/hashset.asm +++ b/src/hashset.asm @@ -53,6 +53,11 @@ pub contains: add r13, r13, 12 jmp r3 ; Calling the hash function with element in r1, context in r2 + cmp r1, rz + jne contains_skip_one + add r1, r1, 1 ; If hash is zero, we add 1. That way hash being 0 means the item does not exist at a position + contains_skip_one: + mov r12, r1 add r10, r9, 16