Skip to content

Commit

Permalink
Fix RCS1239
Browse files Browse the repository at this point in the history
  • Loading branch information
RoosterDragon committed Oct 30, 2023
1 parent 59fa705 commit 75a4ab2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1120,3 +1120,6 @@ dotnet_diagnostic.RCS1233.severity = warning

# Optimize method call.
dotnet_diagnostic.RCS1235.severity = warning

# Use 'for' statement instead of 'while' statement.
dotnet_diagnostic.RCS1239.severity = warning
4 changes: 1 addition & 3 deletions OpenRA.Mods.Common/FileFormats/Blast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ public BitReader(Stream stream)
public int ReadBits(int count)
{
var ret = 0;
var filled = 0;
while (filled < count)
for (var filled = 0; filled < count; filled++)
{
if (bitCount == 0)
{
Expand All @@ -226,7 +225,6 @@ public int ReadBits(int count)
ret |= (bitBuffer & 1) << filled;
bitBuffer >>= 1;
bitCount--;
filled++;
}

return ret;
Expand Down

0 comments on commit 75a4ab2

Please sign in to comment.