Skip to content

Commit 3f53f2c

Browse files
committed
Remove ImmutableArrayFactory and use new API
1 parent 0080405 commit 3f53f2c

File tree

4 files changed

+5
-23
lines changed

4 files changed

+5
-23
lines changed

src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ The System.Collections.Immutable library is built-in as part of the shared frame
2424
<Compile Include="System\Collections\Frozen\FrozenHashTable.cs" />
2525
<Compile Include="System\Collections\Frozen\FrozenSet.cs" />
2626
<Compile Include="System\Collections\Frozen\FrozenSetInternalBase.cs" />
27-
<Compile Include="System\Collections\Frozen\ImmutableArrayFactory.cs" />
2827
<Compile Include="System\Collections\Frozen\ItemsFrozenSet.cs" />
2928
<Compile Include="System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs" />
3029
<Compile Include="System\Collections\Frozen\SmallFrozenDictionary.cs" />

src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenDictionary.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Diagnostics.CodeAnalysis;
88
using System.Linq;
99
using System.Runtime.CompilerServices;
10+
using System.Runtime.InteropServices;
1011

1112
namespace System.Collections.Frozen
1213
{
@@ -338,7 +339,7 @@ public abstract class FrozenDictionary<TKey, TValue> : IDictionary<TKey, TValue>
338339
/// <remarks>
339340
/// The order of the keys in the dictionary is unspecified, but it is the same order as the associated values returned by the <see cref="Values"/> property.
340341
/// </remarks>
341-
public ImmutableArray<TKey> Keys => ImmutableArrayFactory.Create(KeysCore);
342+
public ImmutableArray<TKey> Keys => ImmutableCollectionsMarshal.AsImmutableArray(KeysCore);
342343

343344
/// <inheritdoc cref="Keys" />
344345
private protected abstract TKey[] KeysCore { get; }
@@ -360,7 +361,7 @@ public abstract class FrozenDictionary<TKey, TValue> : IDictionary<TKey, TValue>
360361
/// <remarks>
361362
/// The order of the values in the dictionary is unspecified, but it is the same order as the associated keys returned by the <see cref="Keys"/> property.
362363
/// </remarks>
363-
public ImmutableArray<TValue> Values => ImmutableArrayFactory.Create(ValuesCore);
364+
public ImmutableArray<TValue> Values => ImmutableCollectionsMarshal.AsImmutableArray(ValuesCore);
364365

365366
/// <inheritdoc cref="Values" />
366367
private protected abstract TValue[] ValuesCore { get; }

src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenSet.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Diagnostics.CodeAnalysis;
88
using System.Linq;
99
using System.Numerics;
10+
using System.Runtime.InteropServices;
1011

1112
namespace System.Collections.Frozen
1213
{
@@ -274,7 +275,7 @@ public abstract class FrozenSet<T> : ISet<T>,
274275

275276
/// <summary>Gets a collection containing the values in the set.</summary>
276277
/// <remarks>The order of the values in the set is unspecified.</remarks>
277-
public ImmutableArray<T> Items => ImmutableArrayFactory.Create(ItemsCore);
278+
public ImmutableArray<T> Items => ImmutableCollectionsMarshal.AsImmutableArray(ItemsCore);
278279

279280
/// <inheritdoc cref="Items" />
280281
private protected abstract T[] ItemsCore { get; }

src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/ImmutableArrayFactory.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)