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
Replace interface/abstract types with concrete types #6621
base: master
Are you sure you want to change the base?
Replace interface/abstract types with concrete types #6621
Conversation
824f557
to
e981e0c
Compare
|
@@ -365,7 +365,7 @@ private void UpdateEffect() | |||
_upscaledTexture = null; | |||
break; | |||
case ScalingFilter.Fsr: | |||
if (_scalingFilter is not FsrScalingFilter) | |||
if (_scalingFilter is null) | |||
{ | |||
_scalingFilter?.Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be removed null since it is always null?
The whole thing could be just:
_scalingFilter ??= new FsrScalingFilter(_renderer);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated with your feedback
@@ -559,7 +559,7 @@ private void UpdateEffect() | |||
_isLinear = _currentScalingFilter == ScalingFilter.Bilinear; | |||
break; | |||
case ScalingFilter.Fsr: | |||
if (_scalingFilter is not FsrScalingFilter) | |||
if (_scalingFilter is null) | |||
{ | |||
_scalingFilter?.Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated with your feedback
@marco-carvalho Needs a rebase |
430e8fa
to
d69544b
Compare
@IsaacMarovitz done! |
This PR replaces interface/abstract types with concrete types in some sections. By specifying concrete types instead of interfaces or abstract classes, we leverage compile-time type resolution, enabling the compiler to make optimizations such as method inlining.