Skip to content

Commit

Permalink
Task.FromResult should never be awaited -- you're waiting for nothing…
Browse files Browse the repository at this point in the history
…. This only results in slowness and complexity for nothing.
  • Loading branch information
dmarkle committed Dec 16, 2024
1 parent 580da21 commit 3496fac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Snowflake.Data/Core/SFMultiStatementsResultSet.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2022 Snowflake Computing Inc. All rights reserved.
*/

Expand Down Expand Up @@ -72,7 +72,7 @@ internal override async Task<bool> NextResultAsync(CancellationToken cancellatio
}

updateResultMetadata();
return await Task.FromResult(curResultSet != null);
return curResultSet != null;
}

internal override bool NextResult()
Expand Down
6 changes: 3 additions & 3 deletions Snowflake.Data/Core/SFResultSet.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved.
*/

Expand Down Expand Up @@ -157,9 +157,9 @@ internal override bool NextResult()
return false;
}

internal override async Task<bool> NextResultAsync(CancellationToken cancellationToken)
internal override Task<bool> NextResultAsync(CancellationToken cancellationToken)
{
return await Task.FromResult(false);
return Task.FromResult(false);
}

internal override bool HasRows()
Expand Down

0 comments on commit 3496fac

Please sign in to comment.