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

Remove unnecessary constructor

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