Skip to content

Commit

Permalink
Use more efficient .string instead of .foldMonoid
Browse files Browse the repository at this point in the history
  • Loading branch information
kciesielski committed May 17, 2024
1 parent 9659fab commit ee6f27c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private[http4s] class Http4sRequestBody[F[_]: Async](

bodyType match {
case RawBodyType.StringBody(defaultCharset) =>
body.through(decodeWithCharset(charset.map(_.nioCharset).getOrElse(defaultCharset))).compile.foldMonoid.map(RawValue(_))
body.through(decodeWithCharset(charset.map(_.nioCharset).getOrElse(defaultCharset))).compile.string.map(RawValue(_))
case RawBodyType.ByteArrayBody => asByteArray.map(RawValue(_))
case RawBodyType.ByteBufferBody => asChunk.map(c => RawValue(c.toByteBuffer))
case RawBodyType.InputStreamBody =>
Expand Down

0 comments on commit ee6f27c

Please sign in to comment.