Skip to content

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

Merged
lrytz merged 1 commit intoscala:2.11.xfrom
Ichoran:issue/8815
Sep 16, 2014
Merged

SI-8815 mutable.LongMap makes different choices for splitAt vs etc.#3941
lrytz merged 1 commit intoscala:2.11.xfrom
Ichoran:issue/8815

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