Skip to content

Commit

Permalink
Improve performance in ConsoleProgressBarConsumer.accept
Browse files Browse the repository at this point in the history
  • Loading branch information
heroesleo65 authored and ctongfei committed Jul 7, 2021
1 parent e252b4a commit a9c99a0
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ public int getMaxRenderedLength() {

@Override
public void accept(String str) {
int displayLength = StringDisplayUtils.getStringDisplayLength(str);
int acceptedLength = Math.min(displayLength, getMaxRenderedLength());
out.print(CARRIAGE_RETURN + StringDisplayUtils.trimDisplayLength(str, acceptedLength));
out.print(CARRIAGE_RETURN + StringDisplayUtils.trimDisplayLength(str, getMaxRenderedLength()));
}

@Override
Expand Down

0 comments on commit a9c99a0

Please sign in to comment.