Skip to content

Commit

Permalink
Performance: String+ operation is faster than explicit StringBuilder.…
Browse files Browse the repository at this point in the history
…append() method
  • Loading branch information
mkarg committed Dec 22, 2024
1 parent 8314822 commit 382eb1b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions jaxrs-api/src/main/java/jakarta/ws/rs/core/Variant.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,13 @@ public boolean equals(final Object obj) {

@Override
public String toString() {
return new StringBuilder("Variant[mediaType=")
.append(mediaType)
.append(", language=")
.append(language)
.append(", encoding=")
.append(encoding)
.append(']')
.toString();
return "Variant[mediaType="
+ mediaType
+ ", language="
+ language
+ ", encoding="
+ encoding
+ ']';
}

/**
Expand Down

0 comments on commit 382eb1b

Please sign in to comment.