Skip to content

Commit

Permalink
fix: Only persist computed track hash if version is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
angelobreuer committed Mar 9, 2024
1 parent 163a479 commit a08567d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ public string ToString(int? version, string? format, IFormatProvider? formatProv
buffer = GC.AllocateUninitializedArray<char>(buffer.Length * 2);
}

return TrackData = new string(buffer[..charsWritten]);
var trackData = new string(buffer[..charsWritten]);

if (version is null)
{
TrackData = trackData;
}

return trackData;
}

public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Expand Down

0 comments on commit a08567d

Please sign in to comment.