Reduce complexity of padding with DateTimeFormatter

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • b21

      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(50, '\t')
        .append(DateTimeFormatter.ISO_DATE)
        .toFormatter();
      String text = dtf.format(LocalDateTime.now());

            Assignee:
            Sergey Tsypanov
            Reporter:
            Sergey Tsypanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: