Skip to content

Commit

Permalink
Optimise optBinaryCodec#streamDecoder (#3237)
Browse files Browse the repository at this point in the history
Co-authored-by: Nabil Abdel-Hafeez <[email protected]>
  • Loading branch information
guizmaii and 987Nabil authored Dec 24, 2024
1 parent e6fa725 commit 47bb96a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ sealed trait HttpContentCodec[A] { self =>
else bc.decode(bytes).map(Some(_))

override def streamDecoder: ZPipeline[Any, DecodeError, Byte, Option[A]] =
ZPipeline.chunks[Byte].map(bc.decode).map(_.toOption)
ZPipeline.chunks[Byte].map(bc.decode(_).toOption)

override def streamEncoder: ZPipeline[Any, Nothing, Option[A], Byte] =
ZPipeline.identity[Option[A]].map(_.fold(Chunk.empty[Byte])(bc.encode)).flattenChunks
Expand Down

0 comments on commit 47bb96a

Please sign in to comment.