Skip to content

Commit

Permalink
Remove unnecessary coroutine from streams/compression.c++
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Jan 22, 2024
1 parent fbd170a commit b57341b
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 b57341b

Please sign in to comment.