Current xbzrle_encode_buffer() do everything in a big loop, which is a little difficult for audience to catch the logic.
We can refine the logic with: * get the length of a run * encode it At the same time, I found the encoding and decoding function has some extra pointer operation. Removing this could save some code space. Wei Yang (2): cutils: remove one unnecessary pointer operation migration/xbzrle: make xbzrle_encode_buffer little easier to read migration/xbzrle.c | 153 +++++++++++++++++++++------------------------ util/cutils.c | 8 +-- 2 files changed, 77 insertions(+), 84 deletions(-) -- 2.19.1