Add appends JSON to the sequence and updates the size counter.
(j JSON)
| 243 | |
| 244 | // Add appends JSON to the sequence and updates the size counter. |
| 245 | func (b *ArrayBuilderWithCounter) Add(j JSON) { |
| 246 | oldCap := cap(b.ab.jsons) |
| 247 | b.ab.Add(j) |
| 248 | b.size += j.Size() + (uintptr)(cap(b.ab.jsons)-oldCap)*jsonInterfaceSize |
| 249 | } |
| 250 | |
| 251 | // Build returns a JSON array built from a JSON sequence. After that, it should |
| 252 | // not be modified any longer. |