Skip to content

Commit

Permalink
Fix for netstandard2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hadashiA committed Jun 16, 2024
1 parent ad4c9b7 commit a9d126d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions VContainer/Assets/VContainer/Runtime/Internal/FreeList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public FreeList(int initialCapacity)
values = new T[initialCapacity];
}

#if NETSTANDARD2_1
public ReadOnlySpan<T?> AsSpan()
{
if (lastIndex < 0)
Expand All @@ -38,6 +39,7 @@ public FreeList(int initialCapacity)
}
return values.AsSpan(0, lastIndex + 1);
}
#endif

public T? this[int index] => values[index];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ public void Dispatch(IPlayerLoopItem item)

public void Run()
{
var span = runners.AsSpan();
var span =
#if NETSTANDARD2_1
runners.AsSpan();
#else
runners;
#endif
for (var i = 0; i < span.Length; i++)
{
var item = span[i];
Expand Down

0 comments on commit a9d126d

Please sign in to comment.