Replace ToArray() with collection expressions
このコミットが含まれているのは:
1 親
6897ecfcb2
コミット
358f378796
4ファイル変更
+6
-7
検索条件に一致するファイルはありません
@@ -162,7 +162,7 @@ internal readonly struct EquatableArray<T>(ImmutableArray<T> array) : IEquatable
|
||||
/// <returns>The newly instantiated array.</returns>
|
||||
public T[] ToArray()
|
||||
{
|
||||
return AsImmutableArray().ToArray();
|
||||
return [.. AsImmutableArray()];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ComputeSharp.SourceGeneration.Helpers;
|
||||
@@ -64,7 +63,7 @@ internal struct ImmutableHashSetBuilder<T> : IDisposable
|
||||
/// <inheritdoc cref="ImmutableArray{T}.Builder.ToImmutable"/>
|
||||
public readonly ImmutableArray<T> ToImmutable()
|
||||
{
|
||||
T[] array = this.set!.ToArray();
|
||||
T[] array = [.. this.set!];
|
||||
|
||||
return Unsafe.As<T[], ImmutableArray<T>>(ref array);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ internal struct ImmutableHashSetBuilder<T> : IDisposable
|
||||
/// <inheritdoc cref="ImmutableArray{T}.Builder.ToArray"/>
|
||||
public readonly T[] ToArray()
|
||||
{
|
||||
return this.set!.ToArray();
|
||||
return [.. this.set!];
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする