Skip to content

Commit 869b16c

Browse files
authored
Merge pull request #331 from fwbrasil/opt-media-type-tostring
cache `MediaType.toString`
2 parents e6ca39f + f38e0ae commit 869b16c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/sttp/model/MediaType.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ case class MediaType(
6363

6464
def isModel: Boolean = mainType.equalsIgnoreCase("model")
6565

66-
override def toString: String = {
66+
override lazy val toString: String = {
6767
val sb = new java.lang.StringBuilder(32) // "application/json; charset=utf-8".length == 31 ;)
6868
sb.append(mainType).append('/').append(subType)
6969
charset match {

0 commit comments

Comments
 (0)