Skip to content

Create StringBuilder with known size of string - #107

Merged
ctongfei merged 1 commit into
ctongfei:0.9.3from
heroesleo65:string_builder_in_render
Jul 7, 2021
Merged

ctongfei merged 1 commit into
ctongfei:0.9.3from
heroesleo65:string_builder_in_render

Conversation

@heroesleo65

Copy link
Copy Markdown
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

ctongfei commented Jul 7, 2021

Copy link
Copy Markdown
Owner

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