@@ -103,15 +103,15 @@ public void Save(Stream stream, IImageEncoder encoder)
103103 /// </summary>
104104 /// <param name="stream">The stream to save the image to.</param>
105105 /// <param name="encoder">The encoder to save the image with.</param>
106- /// <exception cref="System. ArgumentNullException">Thrown if the stream or encoder is null.</exception>
106+ /// <exception cref="ArgumentNullException">Thrown if the stream or encoder is null.</exception>
107107 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
108- public async Task SaveAsync ( Stream stream , IImageEncoder encoder )
108+ public Task SaveAsync ( Stream stream , IImageEncoder encoder )
109109 {
110110 Guard . NotNull ( stream , nameof ( stream ) ) ;
111111 Guard . NotNull ( encoder , nameof ( encoder ) ) ;
112112 this . EnsureNotDisposed ( ) ;
113113
114- await this . AcceptVisitorAsync ( new EncodeVisitor ( encoder , stream ) ) . ConfigureAwait ( false ) ;
114+ return this . AcceptVisitorAsync ( new EncodeVisitor ( encoder , stream ) ) ;
115115 }
116116
117117 /// <summary>
@@ -179,9 +179,8 @@ public EncodeVisitor(IImageEncoder encoder, Stream stream)
179179 public void Visit < TPixel > ( Image < TPixel > image )
180180 where TPixel : unmanaged, IPixel < TPixel > => this . encoder . Encode ( image , this . stream ) ;
181181
182- public async Task VisitAsync < TPixel > ( Image < TPixel > image )
183- where TPixel : unmanaged, IPixel < TPixel >
184- => await this . encoder . EncodeAsync ( image , this . stream ) . ConfigureAwait ( false ) ;
182+ public Task VisitAsync < TPixel > ( Image < TPixel > image )
183+ where TPixel : unmanaged, IPixel < TPixel > => this . encoder . EncodeAsync ( image , this . stream ) ;
185184 }
186185 }
187186}
0 commit comments