summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-02-29 18:39:16 +0000
committerRobin Watts <robin.watts@artifex.com>2012-02-29 18:39:16 +0000
commit46ddb6ea2c7fa8c56006d39dc41836fa6c59f40d (patch)
treec776f573fdef6bbd2c9eec6deecfe7511267007b
parentbbfe635555dce16858403706e2031dd3bfa1a9f1 (diff)
downloadmupdf-46ddb6ea2c7fa8c56006d39dc41836fa6c59f40d.tar.xz
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.
-rw-r--r--fitz/base_hash.c2
1 files changed, 1 insertions, 1 deletions
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;