Re: RFR: 8300818: Reduce complexity of padding with DateTimeFormatter [v5]

2023-04-18 Thread Sergey Tsypanov
> 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();

Re: RFR: 8300818: Reduce complexity of padding with DateTimeFormatter [v5]

2023-04-19 Thread Roger Riggs
On Tue, 18 Apr 2023 18:49:54 GMT, Sergey Tsypanov wrote: >> 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,