From 6117730c85e5d64239337f0e8514109054202f5a Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Mon, 14 Feb 2011 09:32:11 -0800 Subject: Remove the restriction that 0 cannot be a table key. This fixes issue: http://code.google.com/p/upb/issues/detail?id=1 --- src/upb_table.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/upb_table.h') diff --git a/src/upb_table.h b/src/upb_table.h index 20dae92..1918e20 100644 --- a/src/upb_table.h +++ b/src/upb_table.h @@ -23,15 +23,14 @@ extern "C" { #endif -/* Note: the key cannot be zero! Zero is used by the implementation. */ typedef uint32_t upb_inttable_key_t; #define UPB_END_OF_CHAIN (uint32_t)0 -#define UPB_EMPTY_ENTRY (uint32_t)0 typedef struct { upb_inttable_key_t key; - uint32_t next; /* Internal chaining. */ + bool has_entry:1; + uint32_t next:31; // Internal chaining. } upb_inttable_entry; // TODO: consider storing the hash in the entry. This would avoid the need to -- cgit v1.2.3