Skip to content

Commit

Permalink
refactor: simplify compression code in RowCompressor class
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Agarwal <[email protected]>
  • Loading branch information
Aditya-A-garwal committed Feb 15, 2024
1 parent 0cd376e commit a6be435
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/canvasClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ bool RowCompressor::compress(uint8_t *codes, uint16_t count) {
for (unsigned l = 0, r; l < count; ) {
for (r = l; r < count; ++r) {
if (codes[r] == codes[l]) {
if (r < count-1) {
continue;
if (r == count || codes[l] != codes[r]) {
break;
}
r = count;
}
break;
}

if (++numSegments >= NUM_SEGMENTS) {
Expand Down

0 comments on commit a6be435

Please sign in to comment.