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

scala.collection.immutable.LongMap should have firstKey and lastKey to be consistent with IntMap #5151

Closed
scabug opened this issue Nov 5, 2011 · 3 comments

Comments

@scabug
Copy link

scabug commented Nov 5, 2011

IntMap and LongMap are completely similar except for the fact that LongMap does not have firstKey and lastKey. I am not sure if these collections are going to stay in the collections library in the long run, but if so it would be very helpful to add firstKey and lastKey to LongMap (just copy the code from IntMap).

I need this to check if a collection is continuous (c.lastKey-c.firstKey+1 == c.size), because that allows me to do some optimizations. I know I could use c.keys.head and c.keys.last, but that is very inefficient since c.keys.last requires a full traversal of the collection.

@scabug
Copy link
Author

scabug commented Nov 5, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5151?orig=1
Reporter: @rklaehn
Assignee: @mt2309
Affected Versions: 2.9.1

@scabug
Copy link
Author

scabug commented Jan 23, 2013

@mt2309 said:
Pull request scala/scala#1950

@scabug
Copy link
Author

scabug commented Feb 8, 2013

@paulp said:
ce32c1a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant