From a87baa5e58ff13a0333e350d15525cb9b8a00600 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 27 Mar 2019 22:23:52 -0400 Subject: [PATCH] common/buffer: hexdump should skip lines that are the same as previous Previously, it would only skip similar lines if the data was all zeroed. Signed-off-by: Jason Dillaman --- src/common/buffer.cc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 071c385ea9f5f..0e9957a56f773 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -2082,26 +2082,38 @@ void buffer::list::hexdump(std::ostream &out, bool trailing_newline) const out.fill('0'); unsigned per = 16; - bool was_zeros = false, did_star = false; + char last_row_char = '\0'; + bool was_same = false, did_star = false; for (unsigned o=0; o