Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/23055 )
Change subject: [util] eliminate compiler warnings in RLE encoding debug checks ...................................................................... Patch Set 1: (1 comment) http://gerrit.cloudera.org:8080/#/c/23055/1/src/kudu/util/rle-encoding.h File src/kudu/util/rle-encoding.h: http://gerrit.cloudera.org:8080/#/c/23055/1/src/kudu/util/rle-encoding.h@409 PS1, Line 409: ValueCheck<T, BIT_WIDTH>::Check(value); I'd rather think of doing this using constexpr. It's easier to read and it's always under DCHECK() at the top level: if constexpr (BIT_WIDTH < 64 && BIT_WIDTH > 1) { DCHECK(value < (1LL << BIT_WIDTH)); } To address BIT_WIDTH == 1 and T == bool case, one could also add one extra static_assert() into the constructor: static_assert(BIT_WIDTH > 1 || (BIT_WIDTH == 1 && std::is_same<T, bool>::value)); -- To view, visit http://gerrit.cloudera.org:8080/23055 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I230fb92acb18aeda29766f2f131beac9eca8dab9 Gerrit-Change-Number: 23055 Gerrit-PatchSet: 1 Gerrit-Owner: KeDeng <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Fri, 20 Jun 2025 07:21:59 +0000 Gerrit-HasComments: Yes
