diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-18 01:59:43 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-18 12:46:33 +0800 |
commit | 4f79809193250b8f791b2f56afc1bc3a1da24956 (patch) | |
tree | 44f5d8aaa2322986c8326bf3a806c7b6f14fa538 /source/fitz/hash.c | |
parent | c53182cabd976b952060d1749ecde00148fbd4e6 (diff) | |
download | mupdf-4f79809193250b8f791b2f56afc1bc3a1da24956.tar.xz |
Make printing empty hash table entries optional.
Diffstat (limited to 'source/fitz/hash.c')
-rw-r--r-- | source/fitz/hash.c | 8 |
1 files changed, 4 insertions, 4 deletions
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++) |