Fix clang-tidy bugprone-branch-clone warnings in headers

This commit is contained in:
Tim Wojtulewicz 2025-06-08 22:20:40 -07:00
parent 694e53e47b
commit b27eba6533
3 changed files with 5 additions and 5 deletions

View file

@ -628,7 +628,7 @@ public:
if ( max_entries < num_entries ) if ( max_entries < num_entries )
max_entries = num_entries; max_entries = num_entries;
if ( num_entries > ThresholdEntries() ) if ( num_entries > ThresholdEntries() )
SizeUp(); SizeUp(); // NOLINT(bugprone-branch-clone)
// if space_distance is too great, performance decreases. we need to sizeup for // if space_distance is too great, performance decreases. we need to sizeup for
// performance. // performance.

View file

@ -366,7 +366,7 @@ public:
*/ */
const ip6_mobility* MobilityHeader() const { const ip6_mobility* MobilityHeader() const {
if ( ip4 ) if ( ip4 )
return nullptr; return nullptr; // NOLINT(bugprone-branch-clone)
else if ( (*ip6_hdrs)[ip6_hdrs->Size() - 1]->Type() != IPPROTO_MOBILITY ) else if ( (*ip6_hdrs)[ip6_hdrs->Size() - 1]->Type() != IPPROTO_MOBILITY )
return nullptr; return nullptr;
else else

View file

@ -1166,8 +1166,8 @@ function hexdump%(data_str: string%) : string
#define HEX_LINE_RIGHT_MIDDLE 31 #define HEX_LINE_RIGHT_MIDDLE 31
#define HEX_BLOCK_LEN 23 #define HEX_BLOCK_LEN 23
#define HEX_LINE_BYTES 16 #define HEX_LINE_BYTES 16
#define NULL_CHAR '.' constexpr char NULL_CHAR = '.';
#define NONPRINT_CHAR '.' constexpr char NONPRINT_CHAR = '.';
const u_char* data = data_str->Bytes(); const u_char* data = data_str->Bytes();
unsigned data_size = data_str->Len(); unsigned data_size = data_str->Len();
@ -1211,7 +1211,7 @@ function hexdump%(data_str: string%) : string
// If unprintable, use special characters: // If unprintable, use special characters:
if ( val < 0x20 || val >= 0x7f ) if ( val < 0x20 || val >= 0x7f )
{ {
if ( val == 0 ) if ( val == 0x00 )
ascii_byte = NULL_CHAR; ascii_byte = NULL_CHAR;
else else
ascii_byte = NONPRINT_CHAR; ascii_byte = NONPRINT_CHAR;