From 3496fac3d5ad6c69abe213e5444718bde3c4cf36 Mon Sep 17 00:00:00 2001 From: David Markle Date: Mon, 16 Dec 2024 13:17:31 -0500 Subject: [PATCH] Task.FromResult should never be awaited -- you're waiting for nothing. This only results in slowness and complexity for nothing. --- Snowflake.Data/Core/SFMultiStatementsResultSet.cs | 4 ++-- Snowflake.Data/Core/SFResultSet.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Snowflake.Data/Core/SFMultiStatementsResultSet.cs b/Snowflake.Data/Core/SFMultiStatementsResultSet.cs index 18eb4f650..5a514ccfb 100644 --- a/Snowflake.Data/Core/SFMultiStatementsResultSet.cs +++ b/Snowflake.Data/Core/SFMultiStatementsResultSet.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Snowflake Computing Inc. All rights reserved. */ @@ -72,7 +72,7 @@ internal override async Task NextResultAsync(CancellationToken cancellatio } updateResultMetadata(); - return await Task.FromResult(curResultSet != null); + return curResultSet != null; } internal override bool NextResult() diff --git a/Snowflake.Data/Core/SFResultSet.cs b/Snowflake.Data/Core/SFResultSet.cs index e81db8c14..5783ab217 100755 --- a/Snowflake.Data/Core/SFResultSet.cs +++ b/Snowflake.Data/Core/SFResultSet.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved. */ @@ -157,9 +157,9 @@ internal override bool NextResult() return false; } - internal override async Task NextResultAsync(CancellationToken cancellationToken) + internal override Task NextResultAsync(CancellationToken cancellationToken) { - return await Task.FromResult(false); + return Task.FromResult(false); } internal override bool HasRows()