Skip to content

SI-8815 mutable.LongMap makes different choices for splitAt vs etc. #3941

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

Merged
merged 1 commit into from
Sep 16, 2014

Conversation

Ichoran
Copy link
Contributor

@Ichoran Ichoran commented Aug 25, 2014

It turns out that take/drop/splitAt/takeWhile/dropWhile inherit a smattering of foreach vs. iterator-based implementations. These aren't consistent unless they iterate in the same order. This probably reflects an undesirable underlying weakness, but in this particular case it was easy to make LongMap's foreach order agree with iterator.

Made traversal order of other foreach-like methods match also.

Also fixed a bug where Long.MinValue wasn't iterated.

@lrytz
Copy link
Member

lrytz commented Aug 26, 2014

I think we should add some unit tests for these fixes. Or do we rely on the upcoming test generator?

@gkossakowski
Copy link
Contributor

ping @Ichoran

@Ichoran
Copy link
Contributor Author

Ichoran commented Sep 9, 2014

@lrytz @gkossakowski - I was not going to bother with extra unit tests because the collections test generator catches these (that's how I found them in the first place). In fact, once the test generator is in place I'd like to rip out a bunch of unit tests that are no longer necessary to speed up the tests. Maybe I should add a test for Long.MinValue, though--that isn't part of the testing.

It turns out that take/drop/splitAt/takeWhile/dropWhile inherit a smattering of foreach vs. iterator-based implementations.  These aren't consistent unless they iterate in the same order.  This probably reflects an undesirable underlying weakness, but in this particular case it was easy to make LongMap's foreach order agree with iterator.

Made traversal order of other foreach-like methods match also.

Also fixed a bug where Long.MinValue wasn't iterated.

Added unit test for iteration coverage of extreme values.
@Ichoran
Copy link
Contributor Author

Ichoran commented Sep 12, 2014

@lrytz @gkossakowski - I added a unit test to test potentially special values.

@lrytz
Copy link
Member

lrytz commented Sep 16, 2014

LGTM

lrytz added a commit that referenced this pull request Sep 16, 2014
SI-8815  mutable.LongMap makes different choices for splitAt vs etc.
@lrytz lrytz merged commit 75f1235 into scala:2.11.x Sep 16, 2014
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.

4 participants