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

Avoid false positives of "Repeated property access of built in components is inefficient" #1544

Closed
real-mikhail opened this issue Feb 26, 2020 · 0 comments
Milestone

Comments

@real-mikhail
Copy link
Member

Example of false positive:
image (8)

When I looked into decompiled code I saw that it just returns private member so it brings one indirection level (which can be optimized by compiler). I consider this is quite non-essential microoptimization. But introducing local variable for a lot of simple cases readability can easily be reduced (not always, of course) so there is a negative impact on this fix as well. And that confronts me with the need to decide whether I'm ready to see these false positives across source code or I have to disable this inspection altogether and endanger me having indeed several transitions into native code where I've could avoid that by caching property value.
So... I think it would be really great if this warning would be shown only for property accesses where in fact happens transition into native code
See:
https://github.com/JetBrains/resharper-unity/wiki/Avoid-multiple-unnecessary-property-accesses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants