Skip to content

Commit

Permalink
Use loop for infinite looping
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik authored and danielrh committed Mar 16, 2024
1 parent c10b88d commit 81666a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/enc/encode.rs
Expand Up @@ -2709,7 +2709,7 @@ fn ProcessMetadata<
{
return 0i32;
}
while 1i32 != 0 {
loop {
if InjectFlushOrPushOutput(s, available_out, next_out_array, next_out_offset, total_out)
!= 0
{
Expand Down Expand Up @@ -2844,7 +2844,7 @@ fn BrotliEncoderCompressStreamFast<Alloc: BrotliAlloc>(
literal_buf = <Alloc as Allocator<u8>>::alloc_cell(&mut s.m8, buf_size);
}
}
while 1i32 != 0 {
loop {
if InjectFlushOrPushOutput(s, available_out, next_out_array, next_out_offset, total_out)
!= 0
{
Expand Down Expand Up @@ -3044,7 +3044,7 @@ pub fn BrotliEncoderCompressStream<
total_out,
);
}
while 1i32 != 0 {
loop {
let remaining_block_size: usize = RemainingInputBlockSize(s);
if remaining_block_size != 0usize && (*available_in != 0usize) {
let copy_input_size: usize = brotli_min_size_t(remaining_block_size, *available_in);
Expand Down
4 changes: 2 additions & 2 deletions src/enc/entropy_encode.rs
Expand Up @@ -496,7 +496,7 @@ fn BrotliWriteHuffmanTreeRepetitions(
} else {
let start: usize = *tree_size;
repetitions = repetitions.wrapping_sub(3);
while 1i32 != 0 {
loop {
tree[*tree_size] = 16u8;
extra_bits_data[*tree_size] = (repetitions & 0x3usize) as u8;
*tree_size = tree_size.wrapping_add(1);
Expand Down Expand Up @@ -539,7 +539,7 @@ fn BrotliWriteHuffmanTreeRepetitionsZeros(
} else {
let start: usize = *tree_size;
repetitions = repetitions.wrapping_sub(3);
while 1i32 != 0 {
loop {
tree[*tree_size] = 17u8;
extra_bits_data[*tree_size] = (repetitions & 0x7usize) as u8;
*tree_size = tree_size.wrapping_add(1);
Expand Down

0 comments on commit 81666a0

Please sign in to comment.