diff options
author | Joshua Haberman <joshua@reverberate.org> | 2011-02-14 09:32:11 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2011-02-14 09:32:11 -0800 |
commit | 6117730c85e5d64239337f0e8514109054202f5a (patch) | |
tree | 8e4a5ce5fee7bf8fffe8671bdd39effd12f56b7a /src/upb_table.h | |
parent | b2d66287d9bf2bc5ebf4af98f11b662c8bf9a4b5 (diff) |
Remove the restriction that 0 cannot be a table key.
This fixes issue:
http://code.google.com/p/upb/issues/detail?id=1
Diffstat (limited to 'src/upb_table.h')
-rw-r--r-- | src/upb_table.h | 5 |
1 files changed, 2 insertions, 3 deletions
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 |