summaryrefslogtreecommitdiff
path: root/src/upb_table.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-02-14 09:32:11 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-02-14 09:32:11 -0800
commit6117730c85e5d64239337f0e8514109054202f5a (patch)
tree8e4a5ce5fee7bf8fffe8671bdd39effd12f56b7a /src/upb_table.h
parentb2d66287d9bf2bc5ebf4af98f11b662c8bf9a4b5 (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.h5
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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback