Skip to content

Commit

Permalink
small optimization (delete branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
aikiriao committed Jun 16, 2024
1 parent 68a52ff commit e28cc54
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions libs/bit_stream/include/bit_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,6 @@ extern const uint32_t g_bitstream_zerobit_runlength_table[0x100];
/* 入力可能な最大ビット数を越えてないか確認 */\
assert((nbits) <= 32);\
\
/* 0ビット取得は0を返す */\
if (!(nbits)) {\
(*(val)) = 0;\
break;\
}\
\
/* バッファから取り出す */\
if ((nbits) <= (stream)->bit_count) {\
(stream)->bit_count -= (nbits);\
Expand Down
6 changes: 0 additions & 6 deletions libs/bit_stream/src/bit_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,6 @@ void BitReader_GetBits(struct BitStream *stream, uint32_t *val, uint32_t nbits)
/* 入力可能な最大ビット数を越えてないか確認 */
assert(nbits <= 32);

/* 0ビット取得は0を返す */
if (!nbits) {
(*val) = 0;
return;
}

/* バッファから取り出す */
if (nbits <= stream->bit_count) {
stream->bit_count -= nbits;
Expand Down

0 comments on commit e28cc54

Please sign in to comment.