From fcd0a0bfaa14d941f913cc522ecc5a3e7ebd8c76 Mon Sep 17 00:00:00 2001 From: wph612 <43688928+vickit144@users.noreply.github.com> Date: Tue, 24 Mar 2020 19:47:18 -0400 Subject: [PATCH] Remove if (f->valid_bits < 0) return 0; on line 1603 I propose to remove this line because f->valid_bits will never be less than zero since, in the while loop, you're adding 8 to it. Therefore, it will always evaluate to false. This is to help remove redundant code. --- stb_vorbis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_vorbis.c b/stb_vorbis.c index b28944a..4e67726 100644 --- a/stb_vorbis.c +++ b/stb_vorbis.c @@ -1600,7 +1600,7 @@ static uint32 get_bits(vorb *f, int n) f->valid_bits += 8; } } - if (f->valid_bits < 0) return 0; + z = f->acc & ((1 << n)-1); f->acc >>= n; f->valid_bits -= n;