scala / collection-strawman

Implementation of the new Scala 2.13 Collections
Apache License 2.0
200 stars 72 forks source link

Add size methods to VectorBuilder #486

Closed NthPortal closed 6 years ago

NthPortal commented 6 years ago

Fixes scala/bug#9904

szeiger commented 6 years ago

Should size be defined in Builder or even in Growable? Do we have any cases where adding to a Builder is cheap but keeping track of the current size would incur an overhead?

NthPortal commented 6 years ago

It doesn't sound like a terrible idea to define size on Builder (my gut says that Growable is too general to reliably track size, but I could be completely wrong there). I don't really know enough to say definitively one way or another - I was just trying to fix the open issue