> Currently it's O(n) - we do `n` shifts of bytes within `StringBuilder`. This > can be reduced to O(1) improving the code like: > > DateTimeFormatter dtf = new DateTimeFormatterBuilder() > .appendLiteral("Date:") > .padNext(20, ' ') > .append(DateTimeFormatter.ISO_DATE) > .toFormatter(); > String text = dtf.format(LocalDateTime.now());
Sergey Tsypanov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge branch 'master' into dtfb - Improve padding of DateTimeFormatter ------------- Changes: - all: https://git.openjdk.org/jdk/pull/12131/files - new: https://git.openjdk.org/jdk/pull/12131/files/b2160f8c..322ae9b4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=12131&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12131&range=00-01 Stats: 95 lines in 17 files changed: 34 ins; 0 del; 61 mod Patch: https://git.openjdk.org/jdk/pull/12131.diff Fetch: git fetch https://git.openjdk.org/jdk pull/12131/head:pull/12131 PR: https://git.openjdk.org/jdk/pull/12131