MCPcopy Create free account
hub / github.com/dop251/goja / grow

Method grow

object_goarray_reflect.go:28–37  ·  view source on GitHub ↗
(newlen int)

Source from the content-addressed store, hash-verified

26}
27
28func (c *valueArrayCache) grow(newlen int) {
29 oldcap := cap(*c)
30 if oldcap < newlen {
31 a := make([]reflectValueWrapper, newlen, growCap(newlen, len(*c), oldcap))
32 copy(a, *c)
33 *c = a
34 } else {
35 *c = (*c)[:newlen]
36 }
37}
38
39func (c *valueArrayCache) put(idx int, w reflectValueWrapper) {
40 if len(*c) <= idx {

Callers 1

putMethod · 0.95

Calls 1

growCapFunction · 0.85

Tested by

no test coverage detected