提交 a185a50d 编写于 作者: C Cyrus Najmabadi

Remove unnecessary constructor

上级 4d104172
......@@ -100,20 +100,13 @@ internal partial struct SymbolKey
/// from any other source is not supported.
/// </summary>
public SymbolKey(string data)
{
_symbolKeyData = data ?? throw new ArgumentNullException();
}
=> _symbolKeyData = data ?? throw new ArgumentNullException();
/// <summary>
/// Constructs a new <see cref="SymbolKey"/> representing the provided <paramref name="symbol"/>.
/// </summary>
public SymbolKey(ISymbol symbol, CancellationToken cancellationToken = default)
: this(CreateString(symbol, cancellationToken))
{
}
internal static SymbolKey Create(ISymbol symbol, CancellationToken cancellationToken = default)
=> new SymbolKey(symbol, cancellationToken);
=> new SymbolKey(CreateString(symbol, cancellationToken));
/// <summary>
/// Returns an <see cref="IEqualityComparer{T}"/> that determines if two <see cref="SymbolKey"/>s
......
......@@ -7,6 +7,6 @@ namespace Microsoft.CodeAnalysis
internal static class SymbolKeyExtensions
{
public static SymbolKey GetSymbolKey(this ISymbol symbol, CancellationToken cancellationToken = default)
=> new SymbolKey(symbol, cancellationToken);
=> SymbolKey.Create(symbol, cancellationToken);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册