Skip to content

Commit 8fdd6b0

Browse files
Use default cancellation token
1 parent 32965d3 commit 8fdd6b0

File tree

4 files changed

+158
-158
lines changed

4 files changed

+158
-158
lines changed

src/ImageSharp/Formats/ImageDecoder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public Image Decode(DecoderOptions options, Stream stream)
3030
s => this.Decode(options, s, default));
3131

3232
/// <inheritdoc/>
33-
public Task<Image<TPixel>> DecodeAsync<TPixel>(DecoderOptions options, Stream stream, CancellationToken cancellationToken)
33+
public Task<Image<TPixel>> DecodeAsync<TPixel>(DecoderOptions options, Stream stream, CancellationToken cancellationToken = default)
3434
where TPixel : unmanaged, IPixel<TPixel>
3535
=> WithSeekableStreamAsync(
3636
options,
@@ -39,7 +39,7 @@ public Task<Image<TPixel>> DecodeAsync<TPixel>(DecoderOptions options, Stream st
3939
cancellationToken);
4040

4141
/// <inheritdoc/>
42-
public Task<Image> DecodeAsync(DecoderOptions options, Stream stream, CancellationToken cancellationToken)
42+
public Task<Image> DecodeAsync(DecoderOptions options, Stream stream, CancellationToken cancellationToken = default)
4343
=> WithSeekableStreamAsync(
4444
options,
4545
stream,
@@ -54,7 +54,7 @@ public IImageInfo Identify(DecoderOptions options, Stream stream)
5454
s => this.Identify(options, s, default));
5555

5656
/// <inheritdoc/>
57-
public Task<IImageInfo> IdentifyAsync(DecoderOptions options, Stream stream, CancellationToken cancellationToken)
57+
public Task<IImageInfo> IdentifyAsync(DecoderOptions options, Stream stream, CancellationToken cancellationToken = default)
5858
=> WithSeekableStreamAsync(
5959
options,
6060
stream,

src/ImageSharp/Formats/ImageEncoder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Six Labors.
1+
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

44
using SixLabors.ImageSharp.Advanced;
@@ -22,7 +22,7 @@ public void Encode<TPixel>(Image<TPixel> image, Stream stream)
2222
=> this.EncodeWithSeekableStream(image, stream, default);
2323

2424
/// <inheritdoc/>
25-
public Task EncodeAsync<TPixel>(Image<TPixel> image, Stream stream, CancellationToken cancellationToken)
25+
public Task EncodeAsync<TPixel>(Image<TPixel> image, Stream stream, CancellationToken cancellationToken = default)
2626
where TPixel : unmanaged, IPixel<TPixel>
2727
=> this.EncodeWithSeekableStreamAsync(image, stream, cancellationToken);
2828

0 commit comments

Comments
 (0)