pamidur / aspect-injector

AOP framework for .NET (c#, vb, etc)
Apache License 2.0
742 stars 111 forks source link

Feature: Replace object[0] to Array.Empty<object> #208

Open Cricle opened 1 year ago

Cricle commented 1 year ago

Describe the solution you'd like In dySpy, no arg method will generated code object[] a = new object[0];, I think it can be replaced to Array.Empty image

Describe alternatives you've considered

[Cache]
[DebuggerStepThrough]
private void Go()
{
object[] a = new object[0];
this.__a$_around_Go_100663300_w_0(a);
}

to

[Cache]
[DebuggerStepThrough]
private void Go()
{
object[] a = Array.Empty<object>();
this.__a$_around_Go_100663300_w_0(a);
}

Additional context No

pamidur commented 1 year ago

Good point. Will try to add to next release