Removal of public def ArrayBuffer.reduceToSize(n: Int) in 2.13.x

I would like to understand the design decision to remove the public method reduceToSize from ArrayBuffer in 2.13.x. In Scala 2.12.x ArrayBuffer had a public method reduceToSize that was implemented in ResizableArray. In Scala 2.13.x ResizebleArray is removed and ArrayBuffer now instead has a private def reduceToSize. To me there is no good public replacement for reduceToSize in Scala 2.13.x and this is also reinforced by the existence of the private helper method.

This change is not mentioned in

and I can not find and discussion in the mailing lists.

So this makes me wonder if the change is an oversight or if there is some good reason for it?

1 Like

b.remove(index, b.length - index) should behave the same and have the same performance

1 Like

There is a current issue about resizing API and behavior. I don’t recall offhand what the current behavior is or what is desired.

I see the comment on remove is

  /** Note: This does not actually resize the internal representation.
    * See trimToSize if you want to also resize internally