Skip to content

Commit 4f14817

Browse files
committed
only read base stream position if needed
1 parent 3393e8f commit 4f14817

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ICSharpCode.SharpZipLib/Zip/ZipOutputStream.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,10 @@ internal void PutNextEntry(Stream stream, ZipEntry entry, long streamOffset = 0,
521521
public async Task PutNextEntryAsync(ZipEntry entry, CancellationToken ct = default)
522522
{
523523
if (curEntry != null) await CloseEntryAsync(ct);
524+
var position = CanPatchEntries ? baseOutputStream_.Position : -1;
524525
await baseOutputStream_.WriteProcToStreamAsync(s =>
525526
{
526-
PutNextEntry(s, entry, baseOutputStream_.Position);
527+
PutNextEntry(s, entry, position);
527528
}, ct);
528529

529530
if (!entry.IsCrypted) return;

0 commit comments

Comments
 (0)