Skip to content

Commit

Permalink
Use ref vars to modify slidePathParts array
Browse files Browse the repository at this point in the history
Structs are still copy on write, so modifying without ref vars only affected the local copy in the loop.
  • Loading branch information
LumpBloom7 committed Aug 12, 2023
1 parent 0a17adf commit 3ceca2b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions osu.Game.Rulesets.Sentakki/Mods/SentakkiModMirror.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ public void ApplyToBeatmap(IBeatmap beatmap)
{
foreach (var slideInfo in slide.SlideInfoList)
{
for (int i = 0; i < slideInfo.SlidePathParts.Length; ++i)
{
var part = slideInfo.SlidePathParts[i];
ref var part = ref slideInfo.SlidePathParts[i];
part.EndOffset = (part.EndOffset * -1).NormalizePath();
part.Mirrored ^= mirrored;
}
Expand Down

0 comments on commit 3ceca2b

Please sign in to comment.