Skip to content

Commit

Permalink
Remove double await and return task directly
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarbosapn committed Sep 4, 2024
1 parent a363abe commit 1e79a19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/StackExchange.Redis/ServerEndPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,17 +1071,17 @@ private async Task HandshakeAsync(PhysicalConnection connection, ILogger? log)
await connection.FlushAsync().ForAwait();
}

private async Task SendAuthMessageAsync(PhysicalConnection connection, Message msg, ResultProcessor<bool> demandOK)
private ValueTask SendAuthMessageAsync(PhysicalConnection connection, Message msg, ResultProcessor<bool> demandOK)
{
if (Multiplexer.RawConfig.WaitForAuth)
{
await WriteDirectAsync(msg, ResultProcessor.DemandOK).ForAwait();
return new ValueTask(WriteDirectAsync(msg, ResultProcessor.DemandOK));
}
else
{
msg.Flags = CommandFlags.FireAndForget;
msg.SetInternalCall();
await WriteDirectOrQueueFireAndForgetAsync(connection, msg, ResultProcessor.DemandOK).ForAwait();
return WriteDirectOrQueueFireAndForgetAsync(connection, msg, ResultProcessor.DemandOK);
}
}

Expand Down

0 comments on commit 1e79a19

Please sign in to comment.