aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-10-12 11:35:09 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-10-12 11:35:09 -0700
commit624997a24da31a7f4955701b37b9612a440b1296 (patch)
treef086ac2a7e0c9954661c5c833c8e10447c0ce29e /src
parent070a2873c5b19a86a3054c295cba4c20a8640d5d (diff)
Code review changes.
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/transport/hashtable.c3
-rw-r--r--src/core/lib/transport/hashtable.h7
2 files changed, 4 insertions, 6 deletions
diff --git a/src/core/lib/transport/hashtable.c b/src/core/lib/transport/hashtable.c
index d127f17a37..a1bae147cc 100644
--- a/src/core/lib/transport/hashtable.c
+++ b/src/core/lib/transport/hashtable.c
@@ -64,8 +64,7 @@ static void grpc_hash_table_add(grpc_hash_table* table, grpc_mdstr* key,
GPR_ASSERT(value != NULL);
const size_t idx =
grpc_hash_table_find_index(table, key, true /* find_empty */);
- // This can happen if the table is full.
- GPR_ASSERT(idx != table->num_entries);
+ GPR_ASSERT(idx != table->num_entries); // Table should never be full.
grpc_hash_table_entry* entry = &table->entries[idx];
entry->key = GRPC_MDSTR_REF(key);
entry->value = vtable->copy_value(value);
diff --git a/src/core/lib/transport/hashtable.h b/src/core/lib/transport/hashtable.h
index 0ce51383c7..d5f40a2cf7 100644
--- a/src/core/lib/transport/hashtable.h
+++ b/src/core/lib/transport/hashtable.h
@@ -39,10 +39,8 @@
* This implementation uses open addressing
* (https://en.wikipedia.org/wiki/Open_addressing) with quadratic
* probing (https://en.wikipedia.org/wiki/Quadratic_probing).
- * This means that the hash table is of fixed size and cannot contain
- * more than that number of elements.
*
- * The keys are grpc_mdstr objects. The values are arbitrary pointers
+ * The keys are \a grpc_mdstr objects. The values are arbitrary pointers
* with a common vtable.
*
* Hash tables are intentionally immutable, to avoid the need for locking.
@@ -76,7 +74,8 @@ int grpc_hash_table_unref(grpc_hash_table* table);
Returns NULL if \a key is not found. */
void* grpc_hash_table_get(const grpc_hash_table* table, const grpc_mdstr* key);
-/** Compares two hash tables. */
+/** Compares two hash tables.
+ The sort order is stable but undefined. */
int grpc_hash_table_cmp(const grpc_hash_table* table1,
const grpc_hash_table* table2);