On Sat, 27 Jul 2024 13:45:11 GMT, Shaojin Wen <d...@openjdk.org> wrote:

> Similar to PR #20321, this improves performance by providing a method that 
> passes in a StringBuilder to avoid unnecessary object allocation.

src/java.base/share/classes/java/time/ZonedDateTime.java line 2222:

> 2220:         if (offset != zone) {
> 2221:             zoneStr = zone.toString();
> 2222:             length += zoneStr.length();

Suggestion:

            length += zoneStr.length() + 2;

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20368#discussion_r1693963178

Reply via email to