Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions main/SS/Formula/FormulaCellCacheEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.
namespace NPOI.SS.Formula
{
using System.Collections;
using System.Collections.Generic;
using NPOI.SS.Formula.Eval;


Expand Down Expand Up @@ -105,19 +106,27 @@ private void ChangeConsumingCells(CellCacheEntry[] usedCells)
{
return;
}
ArrayList usedSet;

HashSet<CellCacheEntry> usedSet;
if (nUsed < 1)
{
usedSet = new ArrayList();
usedSet = new HashSet<CellCacheEntry>();
}
else
{
usedSet = new ArrayList(nUsed * 3 / 2);

#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
usedSet = new HashSet<CellCacheEntry>(nUsed * 3 / 2);
#else
usedSet = new HashSet<CellCacheEntry>();
#endif

for (int i = 0; i < nUsed; i++)
{
usedSet.Add(usedCells[i]);
}
}

for (int i = 0; i < nPrevUsed; i++)
{
CellCacheEntry prevUsed = prevUsedCells[i];
Expand Down