Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Cricle opened this issue Feb 1, 2023 · 1 comment
Open

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

Cricle opened this issue Feb 1, 2023 · 1 comment
Assignees

Comments

@Cricle
Copy link

Cricle commented Feb 1, 2023

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 pamidur self-assigned this Feb 1, 2023
@pamidur
Copy link
Owner

pamidur commented Feb 1, 2023

Good point. Will try to add to next release

@Cricle Cricle changed the title Feature: Replace Array.Empty<object> to object[0] Feature: Replace object[0] to Array.Empty<object> Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants