Skip to content

Commit

Permalink
Merge pull request #1564 from cloudflare/jsnell/remove-unnecessary-co…
Browse files Browse the repository at this point in the history
…routine-compression-stream
  • Loading branch information
jasnell authored Jan 22, 2024
2 parents 4e41cd4 + b57341b commit 8c3cc45
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/workerd/api/streams/compression.c++
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,11 @@ public:
kj::throwFatalException(kj::cp(exception));
}
KJ_CASE_ONEOF(open, Open) {
for (auto &piece : pieces) {
if (piece.size() != 0) {
co_await write(piece.begin(), piece.size());
}
}
co_return;
if (pieces.size() == 0) return kj::READY_NOW;
return write(pieces[0].begin(), pieces[0].size())
.then([this, pieces = pieces.slice(1)]() mutable {
return write(pieces);
});
}
}
KJ_UNREACHABLE;
Expand Down

0 comments on commit 8c3cc45

Please sign in to comment.