From 4a8b9be46c9485a35383b52d400ba086d3f40ace Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 31 Aug 2011 20:03:59 -0700 Subject: Header cleanup, clarify/correct comments for interfaces. --- upb/table.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'upb/table.h') diff --git a/upb/table.h b/upb/table.h index bd9a5d4..4a44a6f 100644 --- a/upb/table.h +++ b/upb/table.h @@ -11,6 +11,9 @@ * The table uses internal chaining with Brent's variation (inspired by the * Lua implementation of hash tables). The hash function for strings is * Austin Appleby's "MurmurHash." + * + * This header is internal to upb; its interface should not be considered + * public or stable. */ #ifndef UPB_TABLE_H_ @@ -128,21 +131,16 @@ INLINE void *_upb_inttable_fastlookup(upb_inttable *t, uint32_t key, upb_inttable_value *arrval = (upb_inttable_value*)UPB_INDEX(t->array, key, value_size); if (_upb_inttable_isarrkey(t, key)) { - //DEBUGPRINTF("array lookup for key %d, &val=%p, has_entry=%d\n", key, val, val->has_entry); return (arrval->has_entry) ? arrval : NULL; } uint32_t bucket = _upb_inttable_bucket(t, key); upb_inttable_entry *e = (upb_inttable_entry*)UPB_INDEX(t->t.entries, bucket, entry_size); - //DEBUGPRINTF("looking in first bucket %d, entry size=%zd, addr=%p\n", bucket, entry_size, e); while (1) { - //DEBUGPRINTF("%d, %d, %d\n", e->val.has_entry, e->hdr.key, key); if (e->hdr.key == key) { - //DEBUGPRINTF("returning val from hash part\n"); return &e->val; } if ((bucket = e->hdr.next) == UPB_END_OF_CHAIN) return NULL; - //DEBUGPRINTF("looking in bucket %d\n", bucket); e = (upb_inttable_entry*)UPB_INDEX(t->t.entries, bucket, entry_size); } } -- cgit v1.2.3