Skip to content

Commit

Permalink
Change to BitArray[]
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane32 committed May 22, 2024
1 parent 5ee8d65 commit a8d492c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions QRCoder/QRCodeGenerator.ModulePlacer.BlockedModules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ private static partial class ModulePlacer
/// </summary>
public struct BlockedModules : IDisposable
{
private readonly bool[][] _blockedModules;
private readonly BitArray[] _blockedModules;

private static bool[][] _staticBlockedModules;
private static BitArray[] _staticBlockedModules;

/// <summary>
/// Initializes a new instance of the <see cref="BlockedModules"/> struct with a specified capacity.
Expand All @@ -27,13 +27,13 @@ public BlockedModules(int size)
if (_blockedModules != null && _blockedModules.Length >= size)
{
for (int i = 0; i < size; i++)
Array.Clear(_blockedModules[i], 0, size);
_blockedModules[i].SetAll(false);
}
else
{
_blockedModules = new bool[size][];
_blockedModules = new BitArray[size];
for (int i = 0; i < size; i++)
_blockedModules[i] = new bool[size];
_blockedModules[i] = new BitArray(size);
}
}

Expand Down

0 comments on commit a8d492c

Please sign in to comment.