Skip to content

Commit

Permalink
Move string to a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardSmit committed Jan 25, 2024
1 parent b5b698b commit 2e7c0cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Zomp.SyncMethodGenerator/AsyncToSyncRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ internal sealed class AsyncToSyncRewriter(SemanticModel semanticModel) : CSharpS
private const string IAsyncEnumerator = "System.Collections.Generic.IAsyncEnumerator";
private const string FromResult = "FromResult";
private const string Delay = "Delay";
private const string CompletedTask = "CompletedTask";
private static readonly HashSet<string> Drops = [IProgressInterface, CancellationTokenType];
private static readonly HashSet<string> InterfacesToDrop = [IProgressInterface, IAsyncResultInterface];
private static readonly Dictionary<string, string?> Replacements = new()
Expand Down Expand Up @@ -1178,7 +1179,7 @@ private static bool ShouldRemoveType(ITypeSymbol symbol)

private static bool ShouldRemoveArgument(ISymbol symbol) => symbol switch
{
IPropertySymbol { Name: "CompletedTask" } ps => ps.Type.ToString() is TaskType or ValueTaskType,
IPropertySymbol { Name: CompletedTask } ps => ps.Type.ToString() is TaskType or ValueTaskType,
IMethodSymbol ms =>
IsSpecialMethod(ms) == SpecialMethod.None
&& ((ShouldRemoveType(ms.ReturnType) && ms.MethodKind != MethodKind.LocalFunction)
Expand Down

0 comments on commit 2e7c0cb

Please sign in to comment.