narr.NArrayBuilder
See theNArrayBuilder companion object
Design notes:
- If you already know the size of the result, you wouldn't use a builder at all.
- Minimize memory footprint and copy operations.
- som-snytt
- That's an interesting experiment worth benchmarking. Personally I'd optimize for new Builder().addAll(xs).result but it depends.
- I like the idea of keeping the "strategy" in a var instead of a confusing if/else.
- Alternatively, switch on the current state
Type parameters
- T
-
type of the Array elements.
Attributes
- Companion
- object
- Source
- NArrayBuilder.scala
- Graph
-
- Supertypes
- Known subtypes
-
trait TypedArrayBuilder[T]class NativeArrayBuilder[T]class ByteArrayBuilderclass DoubleArrayBuilderclass FloatArrayBuilderclass IntArrayBuilderclass ShortArrayBuilder
Members list
In this article