net462 + netstandard2 define a static Array.Empty<T>() helper which returns a cached empty array. There's a few places in the code where we #ifdef this in where it's easy but there's other places where this approach would be cumbersome. It might help to both cleanup the code + give a minor perf boost (via reduced allocations) by creating a helper to handle this.
This would be most useful for v3.13.x but could also have a place in v4 if we continue to target net45 there (#4036). If net45 support is dropped in v4, then we should instead update all callsites to just call Array.Empty<T> directly instead
net462 + netstandard2 define a static
Array.Empty<T>()helper which returns a cached empty array. There's a few places in the code where we#ifdefthis in where it's easy but there's other places where this approach would be cumbersome. It might help to both cleanup the code + give a minor perf boost (via reduced allocations) by creating a helper to handle this.This would be most useful for v3.13.x but could also have a place in v4 if we continue to target net45 there (#4036). If net45 support is dropped in v4, then we should instead update all callsites to just call
Array.Empty<T>directly instead