-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Labels
Description
The code generated for this line,
spray-json/src/main/boilerplate/spray/json/ProductFormatsInstances.scala.template
Line 31 in d0008f5
| fields.sizeHint(1 * 2) |
is expanded to this for instance for jsonFormat21:
def write(p: T) = {
val fields = new collection.mutable.ListBuffer[(String, JsValue)]
fields.sizeHint(20 * 21)
fields ++= productElement2Field[P1](fieldName1, p, 0)
...I don't think ListBuffer actually uses the size hint so it's not that bad but if you ever switched to a different kind of collection that did (and actually side note: why not use Map.newBuilder instead?) it would be quite problematic.