Add Bindable<T>.CopyTo and use in GetUnboundCopy implementation#5531
Merged
smoogipoo merged 5 commits intoppy:masterfrom Nov 22, 2022
Merged
Add Bindable<T>.CopyTo and use in GetUnboundCopy implementation#5531smoogipoo merged 5 commits intoppy:masterfrom
Bindable<T>.CopyTo and use in GetUnboundCopy implementation#5531smoogipoo merged 5 commits intoppy:masterfrom
Conversation
a35029f to
3f1722d
Compare
3f1722d to
0750864
Compare
smoogipoo
requested changes
Nov 22, 2022
Member
Author
|
osu! side changes required: peppy/osu@1632df1 Seems to work okay. |
Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
smoogipoo
approved these changes
Nov 22, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This method is used heavily in
AudioAdjustments, which is how I got here.osu-framework/osu.Framework/Audio/AudioAdjustments.cs
Line 68 in ba13853
Breaking Changes
Bindable<T>.CopyToshould be implemented for any custom bindablesTo improve the performance of creating clones of bindables (ie. via
GetUnboundCopy()), the copy portion ofBindTo()has been split out into its own method. If you have any custom bindable types which were copying values across within aBindTo()override, please move the copy operation toCopyTo()instead. Pay special attention to the direction of assignment, which will reverse from what it was inBindTo.A fix should look something like this: