Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create StringBuilder with known size of string #107

Merged
merged 1 commit into from
Jul 7, 2021

Conversation

heroesleo65
Copy link
Contributor

Result of string does have length equal to given argument maxLength in DefaultProgressBarRenderer.render always. We can use this and create StringBuilder with initial size of array equal to maxLength

@ctongfei
Copy link
Owner

ctongfei commented Jul 7, 2021

It might not be exactly the same as maxLength (various reasons, e.g. East Asian chars). But this fix is good for the performance. Thanks!

@ctongfei ctongfei changed the base branch from main to 0.9.3 July 7, 2021 05:02
@ctongfei ctongfei merged commit 8036da3 into ctongfei:0.9.3 Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants