Skip to content

Commit 81666a0

Browse files
nyurikdanielrh
authored andcommitted
Use loop for infinite looping
1 parent c10b88d commit 81666a0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/enc/encode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2709,7 +2709,7 @@ fn ProcessMetadata<
27092709
{
27102710
return 0i32;
27112711
}
2712-
while 1i32 != 0 {
2712+
loop {
27132713
if InjectFlushOrPushOutput(s, available_out, next_out_array, next_out_offset, total_out)
27142714
!= 0
27152715
{
@@ -2844,7 +2844,7 @@ fn BrotliEncoderCompressStreamFast<Alloc: BrotliAlloc>(
28442844
literal_buf = <Alloc as Allocator<u8>>::alloc_cell(&mut s.m8, buf_size);
28452845
}
28462846
}
2847-
while 1i32 != 0 {
2847+
loop {
28482848
if InjectFlushOrPushOutput(s, available_out, next_out_array, next_out_offset, total_out)
28492849
!= 0
28502850
{
@@ -3044,7 +3044,7 @@ pub fn BrotliEncoderCompressStream<
30443044
total_out,
30453045
);
30463046
}
3047-
while 1i32 != 0 {
3047+
loop {
30483048
let remaining_block_size: usize = RemainingInputBlockSize(s);
30493049
if remaining_block_size != 0usize && (*available_in != 0usize) {
30503050
let copy_input_size: usize = brotli_min_size_t(remaining_block_size, *available_in);

src/enc/entropy_encode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ fn BrotliWriteHuffmanTreeRepetitions(
496496
} else {
497497
let start: usize = *tree_size;
498498
repetitions = repetitions.wrapping_sub(3);
499-
while 1i32 != 0 {
499+
loop {
500500
tree[*tree_size] = 16u8;
501501
extra_bits_data[*tree_size] = (repetitions & 0x3usize) as u8;
502502
*tree_size = tree_size.wrapping_add(1);
@@ -539,7 +539,7 @@ fn BrotliWriteHuffmanTreeRepetitionsZeros(
539539
} else {
540540
let start: usize = *tree_size;
541541
repetitions = repetitions.wrapping_sub(3);
542-
while 1i32 != 0 {
542+
loop {
543543
tree[*tree_size] = 17u8;
544544
extra_bits_data[*tree_size] = (repetitions & 0x7usize) as u8;
545545
*tree_size = tree_size.wrapping_add(1);

0 commit comments

Comments
 (0)