// Array is a shorthand for NewArray(e.config.Reporter, value).
547414
func (e *Expect) Array(value []interface{}) *Array {
	return NewArray(e.config.Reporter, value)
}
903554
func Int64Array(name string, values []int64) FieldOpt {
	return func(em *eventMetadata, ed *eventData) {
		em.writeArray(name, inTypeInt64, outTypeDefault, 0)
		ed.writeUint16(uint16(len(values)))
		for _, v := range values {
			ed.writeInt64(v)
		}
	}
}
528405
func ToArray(value interface{}) (values []string) {
	switch value := value.(type) {
	case []string:
		values = []string{}
		for _, v := range value {
			if v != "" {
				values = append(values, v)
			}
		}
	case []interface{}:
		for _, v := range value {
			values = append(values, fmt.Sprint(v))
		}
	default:
		if value := fmt.Sprint(value); value != "" {
			values = []string{value}
		}
	}
	return
}
1365544
func NewArrayIterator(array Array) Iterator {
	return &arrayIterator{
		basicArrayIterator: basicArrayIterator{array: array, pos: -1},
		array:              array,
		pos:                -1,
	}
}
1057006
func (w *Writer) WriteArray(count int) {
	w.b = AppendArray(w.b, count)
}
960695
func (p Property) IsArray() bool {
	return p.Type == arrayType || strings.HasSuffix(p.TypeString(), "[]")
}
224836
func IsArray(s spec.Schema) bool {
	return len(s.Type) > 0 && s.Type[0] == "array"
}
1360644
func (a *Array) Int(i int) *Array {
	a.buf = enc.AppendInt(enc.AppendArrayDelim(a.buf), i)
	return a
}
345096
func (e *Encoder) encodeArray(valueField reflect.Value, key string) error {
	adaptersCnt := 0
	devicesCnt := 0

	for i := 0; i < valueField.Len(); i++ {
		switch key {
		case "ide":
			if i >= (MAX_IDE_ADAPTERS * MAX_IDE_DEVICES_PER_ADAPTER) {
				return nil
			}

			if devicesCnt >= MAX_IDE_DEVICES_PER_ADAPTER {
				adaptersCnt++
				devicesCnt = 0
			}

			e.parentKey = fmt.Sprintf("%s%d:%d", key, adaptersCnt, devicesCnt)
			devicesCnt++

		case "scsi":
			if i >= (MAX_SCSI_ADAPTERS * MAX_SCSI_DEVICES_PER_ADAPTER) {
				return nil
			}

			if devicesCnt >= MAX_SCSI_DEVICES_PER_ADAPTER {
				adaptersCnt++
				devicesCnt = 0
			}

			val := valueField.Index(i).FieldByName("VirtualDev")
			if !isEmptyValue(val) {
				e.parentKey = fmt.Sprintf("%s%d", key, adaptersCnt)
			} else {
				e.parentKey = fmt.Sprintf("%s%d:%d", key, adaptersCnt, devicesCnt)
				devicesCnt++
			}
		case "sata":
			if i >= (MAX_SATA_ADAPTERS * MAX_SATA_DEVICES_PER_ADAPTER) {
				return nil
			}

			if devicesCnt >= MAX_SATA_DEVICES_PER_ADAPTER {
				adaptersCnt++
				devicesCnt = 0
			}

			e.parentKey = fmt.Sprintf("%s%d:%d", key, adaptersCnt, devicesCnt)
			devicesCnt++
		case "usb":
			if i >= MAX_USB_ADAPTERS*MAX_USB_DEVICES {
				return nil
			}

			e.parentKey = fmt.Sprintf("%s:%d", key, devicesCnt)
			devicesCnt++
		case "ethernet":
			if i >= MAX_VNICS {
				return nil
			}
			e.parentKey = key + strconv.Itoa(i)
		default:
			e.parentKey = key + strconv.Itoa(i)
		}

		err := e.encode(valueField.Index(i))
		if err != nil {
			return err
		}
	}
	return nil
}
927074
func inArray(s byte, list []byte) bool {
	for _, el := range list {
		if el == s {
			return true
		}
	}
	return false
}
494670
func (mat *T) Array() *[9]float32 {
	return &[...]float32{
		mat[0][0], mat[0][1], mat[0][2],
		mat[1][0], mat[1][1], mat[1][2],
		mat[2][0], mat[2][1], mat[2][2],
	}
}
908752
func arrayFirst(input interface{}) interface{} {
	if input == nil {
		return nil
	}

	arr := reflect.ValueOf(input)

	if arr.Len() == 0 {
		return nil
	}

	return arr.Index(0).Interface()
}
62978
func Int8Array(name string, values []int8) FieldOpt {
	return func(em *eventMetadata, ed *eventData) {
		em.writeArray(name, inTypeInt8, outTypeDefault, 0)
		ed.writeUint16(uint16(len(values)))
		for _, v := range values {
			ed.writeInt8(v)
		}
	}
}
154015
func Uint32Array(name string, values []uint32) FieldOpt {
	return func(em *eventMetadata, ed *eventData) {
		em.writeArray(name, inTypeUint32, outTypeDefault, 0)
		ed.writeUint16(uint16(len(values)))
		for _, v := range values {
			ed.writeUint32(v)
		}
	}
}
481809
func (s *StreamEncoder) AddArray(v MarshalerJSONArray) {
	s.Encoder.writeByte('[')
	v.MarshalJSONArray(s.Encoder)
	s.Encoder.writeByte(']')
	s.Encoder.writeByte(s.delimiter)
}
1140656
func (dec *Decoder) Array(v UnmarshalerJSONArray) error {
	newCursor, err := dec.decodeArray(v)
	if err != nil {
		return err
	}
	dec.cursor = newCursor
	dec.called |= 1
	return nil
}
689484
func (d *Decoder) array() ([]interface{}, error) {
	// the '[' token already scanned
	d.pos++

	var (
		c     byte
		v     interface{}
		err   error
		array = make([]interface{}, 0)
	)

	// look ahead for ] - if the array is empty.
	if c = d.skipSpaces(); c == ']' {
		d.pos++
		goto out
	}

scan:
	if v, err = d.any(); err != nil {
		goto out
	}

	array = append(array, v)

	// next token must be ',' or ']'
	if c = d.skipSpaces(); c == ',' {
		d.pos++
		goto scan
	} else if c == ']' {
		d.pos++
	} else {
		err = d.error(c, "after array element")
	}

out:
	return array, err
}