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

Pass size when wrapping array with ProgressBarBuilder #101

Merged
merged 1 commit into from
May 21, 2021

Conversation

seanf
Copy link
Contributor

@seanf seanf commented May 21, 2021

When wrapping an array and customising the ProgressBar with a ProgressBarBuilder, the size of the array is not used. This change brings arrays in line with Iterable and Spliterator, which do use the size when known.

@seanf
Copy link
Contributor Author

seanf commented May 21, 2021

Another option would be to expose ProgressBarBuilder.getInitialMax(), and only call setInitialMax() if the current value is still -1. For consistency, this could be done for Iterable and Spliterator too.

@ctongfei
Copy link
Owner

Thanks @seanf ! This is excellent. This will be released in the next version.

@ctongfei ctongfei merged commit 5696195 into ctongfei:main May 21, 2021
ctongfei added a commit that referenced this pull request May 21, 2021
@seanf seanf deleted the array-size branch September 22, 2021 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants