From 4f79809193250b8f791b2f56afc1bc3a1da24956 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 18 Sep 2016 01:59:43 +0800 Subject: Make printing empty hash table entries optional. --- source/fitz/hash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/fitz/hash.c') diff --git a/source/fitz/hash.c b/source/fitz/hash.c index bc1d2376..31a692c0 100644 --- a/source/fitz/hash.c +++ b/source/fitz/hash.c @@ -327,11 +327,11 @@ fz_hash_remove_fast(fz_context *ctx, fz_hash_table *table, const void *key, unsi void fz_print_hash(fz_context *ctx, fz_output *out, fz_hash_table *table) { - fz_print_hash_details(ctx, out, table, NULL); + fz_print_hash_details(ctx, out, table, NULL, 0); } void -fz_print_hash_details(fz_context *ctx, fz_output *out, fz_hash_table *table, void (*details)(fz_context*,fz_output*,void*)) +fz_print_hash_details(fz_context *ctx, fz_output *out, fz_hash_table *table, void (*details)(fz_context*,fz_output*,void*), int compact) { int i, k; @@ -339,9 +339,9 @@ fz_print_hash_details(fz_context *ctx, fz_output *out, fz_hash_table *table, voi for (i = 0; i < table->size; i++) { - if (!table->ents[i].val) + if (!table->ents[i].val && !compact) fz_printf(ctx, out, "table %04d: empty\n", i); - else + else if (table->ents[i].val) { fz_printf(ctx, out, "table %04d: key=", i); for (k = 0; k < MAX_KEY_LEN; k++) -- cgit v1.2.3