Skip to content

Commit a4898b6

Browse files
Copilotpetesramek
andcommitted
refactor: remove unnecessary await Task.CompletedTask from async iterators
Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com> Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/8bac762b-8608-43c2-9c46-e9485c2acf63
1 parent 52df251 commit a4898b6

4 files changed

Lines changed: 0 additions & 8 deletions

File tree

src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ public async IAsyncEnumerable<TCoordinate> DecodeAsync(
167167
cancellationToken.ThrowIfCancellationRequested();
168168
yield return coordinate;
169169
}
170-
171-
await Task.CompletedTask.ConfigureAwait(false);
172170
}
173171

174172
/// <summary>

src/PolylineAlgorithm/Extensions/AsyncPolylineEncoderExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,5 @@ private static async IAsyncEnumerable<Coordinate> ToAsyncEnumerable(
5959
cancellationToken.ThrowIfCancellationRequested();
6060
yield return item;
6161
}
62-
63-
await System.Threading.Tasks.Task.CompletedTask.ConfigureAwait(false);
6462
}
6563
}

tests/PolylineAlgorithm.Tests/AsyncPolylineEncoderTest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,5 @@ private static async IAsyncEnumerable<Coordinate> ToAsyncEnumerable(IEnumerable<
144144
foreach (var item in source) {
145145
yield return item;
146146
}
147-
148-
await Task.CompletedTask;
149147
}
150148
}

tests/PolylineAlgorithm.Tests/PolylinePipeEncoderTest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,5 @@ private static async IAsyncEnumerable<Coordinate> ToAsyncEnumerable(IEnumerable<
133133
foreach (var item in source) {
134134
yield return item;
135135
}
136-
137-
await Task.CompletedTask;
138136
}
139137
}

0 commit comments

Comments
 (0)