From b2bc25c89f2d825a9c4a7d8c38cfade34a93e890 Mon Sep 17 00:00:00 2001 From: Ynse Hoornenborg Date: Fri, 10 Dec 2021 13:49:55 +0100 Subject: [PATCH] No need to await async PbmDecoder methods --- src/ImageSharp/Formats/Pbm/PbmDecoder.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ImageSharp/Formats/Pbm/PbmDecoder.cs b/src/ImageSharp/Formats/Pbm/PbmDecoder.cs index 62cef176d..c00e4affe 100644 --- a/src/ImageSharp/Formats/Pbm/PbmDecoder.cs +++ b/src/ImageSharp/Formats/Pbm/PbmDecoder.cs @@ -54,9 +54,8 @@ namespace SixLabors.ImageSharp.Formats.Pbm } /// - public async Task DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) - => await this.DecodeAsync(configuration, stream, cancellationToken) - .ConfigureAwait(false); + public Task DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) + => this.DecodeAsync(configuration, stream, cancellationToken); /// public IImageInfo Identify(Configuration configuration, Stream stream) @@ -68,16 +67,12 @@ namespace SixLabors.ImageSharp.Formats.Pbm } /// - public async Task IdentifyAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) + public Task IdentifyAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) { Guard.NotNull(stream, nameof(stream)); - // The introduction of a local variable that refers to an object the implements - // IDisposable means you must use async/await, where the compiler generates the - // state machine and a continuation. var decoder = new PbmDecoderCore(configuration); - return await decoder.IdentifyAsync(configuration, stream, cancellationToken) - .ConfigureAwait(false); + return decoder.IdentifyAsync(configuration, stream, cancellationToken); } } }