İçeriğe geç

Array empty (ARCH603)

Anahtar dotnet.performance.array-empty · Onem warning · Kategori performance

Her bos dizi olusturmak yeni bir tahsisattir; Array.Empty<T>() onbellekli tek bir ornek dondurur.

public int[] GetIds() => new int[0];
public int[] GetIds() => Array.Empty<int>();

Bos diziler icin Array.Empty<T>() kullanin.