MCPcopy
hub / github.com/pelletier/go-toml / arrayCount

Method arrayCount

unmarshaler.go:389–397  ·  view source on GitHub ↗

arrayCount returns the number of elements appended so far to the array table at the given path.

(key []byte)

Source from the content-addressed store, hash-verified

387// arrayCount returns the number of elements appended so far to the array
388// table at the given path.
389func (d *decoder) arrayCount(key []byte) int {
390 if d.arrayCounts == nil {
391 return 0
392 }
393 if p := d.arrayCounts[string(key)]; p != nil { // does not allocate
394 return *p
395 }
396 return 0
397}
398
399func (d *decoder) setArrayCount(key []byte, n int) {
400 if d.arrayCounts == nil {

Callers 2

walkTableMethod · 0.95
descendMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected