diff options
-rw-r--r-- | cmd/zdb/zdb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 329562418..9a0ffd25e 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -1004,11 +1004,13 @@ dump_histogram(const uint64_t *histo, int size, int offset) uint64_t max = 0; for (i = 0; i < size; i++) { + if (histo[i] == 0) + continue; if (histo[i] > max) max = histo[i]; - if (histo[i] > 0 && i > maxidx) + if (i > maxidx) maxidx = i; - if (histo[i] > 0 && i < minidx) + if (i < minidx) minidx = i; } |