Skip to content

Commit

Permalink
Mark TokenData as a 'readonly struct'
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Oct 27, 2018
1 parent 72e2a2a commit 00d164f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Workspaces/Core/Portable/Formatting/Engine/TokenData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ namespace Microsoft.CodeAnalysis.Formatting
/// this object is supposed to be live very short but created a lot of time. that is why it is struct.
/// (same reason why SyntaxToken is struct - to reduce heap allocation)
/// </summary>
internal struct TokenData : IEqualityComparer<TokenData>, IEquatable<TokenData>, IComparable<TokenData>, IComparer<TokenData>
internal readonly struct TokenData : IEqualityComparer<TokenData>, IEquatable<TokenData>, IComparable<TokenData>, IComparer<TokenData>
{
public TokenData(TokenStream tokenStream, int indexInStream, SyntaxToken token) : this()
public TokenData(TokenStream tokenStream, int indexInStream, SyntaxToken token)
{
Contract.ThrowIfNull(tokenStream);
Contract.ThrowIfFalse((indexInStream == -1) || (0 <= indexInStream && indexInStream < tokenStream.TokenCount));
Expand Down

0 comments on commit 00d164f

Please sign in to comment.