Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit 1d299ca

Browse files
committed
Take ArrayOps out of the collection hierarchy
All collection-related methods for arrays are available on WrappedArray so there is no need to duplicate them in ArrayOps. This allows ArrayOps to be implemented as a value class with no inherited methods, thus it should never be necessary to allocate an instance of it. Unlike in the old collection library `ArrayOps` is not specialized. The methods that were specialized before don’t seen worth specializing. In particular, `apply` and `update` which *should* be specialized on arrays are not provided at all by the new `ArrayOps` because they are available natively on `Array`. The old specialization scheme would have no benefit but a high cost: it is incompatible with a pure value class. Almost any ArrayOps call in the old library needs to allocate an instance, with the only exceptions being `length`, `apply` and `update`. New and optimized implementations of many collection methods are provided in ArrayOps, often adapted from Slick’s `ConstArray` class.
1 parent cd45cc0 commit 1d299ca

File tree

6 files changed

+592
-65
lines changed

6 files changed

+592
-65
lines changed

0 commit comments

Comments
 (0)