Skip to content

Pass size when wrapping array with ProgressBarBuilder - #101

Merged
ctongfei merged 1 commit into
ctongfei:mainfrom
seanf:array-size
May 21, 2021
Merged

ctongfei merged 1 commit into
ctongfei:mainfrom
seanf:array-size

Conversation

@seanf

@seanf seanf commented May 21, 2021

Copy link
Copy Markdown
Contributor

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

seanf commented May 21, 2021

Copy link
Copy Markdown
Contributor Author

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