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

Method setValuesFromSparse

array.go:552–558  ·  view source on GitHub ↗
(items []sparseArrayItem, newMaxIdx int)

Source from the content-addressed store, hash-verified

550}
551
552func (a *arrayObject) setValuesFromSparse(items []sparseArrayItem, newMaxIdx int) {
553 a.values = make([]Value, newMaxIdx+1)
554 for _, item := range items {
555 a.values[item.idx] = item.value
556 }
557 a.objCount = len(items)
558}
559
560func toIdx(v valueInt) uint32 {
561 if v >= 0 && v < math.MaxUint32 {

Callers 1

expandMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected