From 46ddb6ea2c7fa8c56006d39dc41836fa6c59f40d Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 29 Feb 2012 18:39:16 +0000 Subject: Fix typo in hash table code. When detecting a clash when inserting into a hash table (which should only ever happen in multithreaded cases), we should give a warning, and return the existing item from the table. The current code doesn't do this due to a stupid typo. Fixed here. CLUSTER_UNTESTED as we don't test multithreaded operation in the cluster. --- fitz/base_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fitz') diff --git a/fitz/base_hash.c b/fitz/base_hash.c index 0fda86cd..76c95304 100644 --- a/fitz/base_hash.c +++ b/fitz/base_hash.c @@ -127,7 +127,7 @@ do_hash_insert(fz_context *ctx, fz_hash_table *table, void *key, void *val) if (memcmp(key, ents[pos].key, table->keylen) == 0) { fz_warn(ctx, "assert: overwrite hash slot"); - return ents[pos].val = val; + return ents[pos].val; } pos = (pos + 1) % size; -- cgit v1.2.3