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

SI-8475 GroupedIterator is also lazy when padded #3795

Merged
merged 1 commit into from Jun 3, 2014

Conversation

som-snytt
Copy link
Contributor

This is the related case which dnlgtm in the previous fix.

The old code seems to be tilting for laziness, but we have
to fill the buffer with the current group anyway, so there
is no reason to be coy about calling ArrayBuffer.length.

This is the related case which dnlgtm in the previous fix.

The old code seems to be tilting for laziness, but we have
to fill the buffer with the current group anyway, so there
is no reason to be coy about calling ArrayBuffer.length.
if (shortBy > 0) res ++ padding(shortBy) else res
}
else res
// was: extra checks so we don't calculate length unless there's reason
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to explain the history, just explain what we do now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a marker that the analysis of laziness is incomplete. (Todo is clarify the comment at 922, unlazy the vals at 956.) If I follow up with a minor refactor of takeDestructively, I will follow your advice and let the dead bury the dead.

@Ichoran
Copy link
Contributor

Ichoran commented May 27, 2014

LGTM, though I would shorten the comment so future maintainers are not unduly burdened with history.

adriaanm added a commit that referenced this pull request Jun 3, 2014
SI-8475 GroupedIterator is also lazy when padded
@adriaanm adriaanm merged commit 1b280b3 into scala:2.11.x Jun 3, 2014
@som-snytt som-snytt deleted the issue/8475 branch July 19, 2014 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants