// runToArray converts from RLE format to array format.
421870
func (c *Container) runToArray() {
	statsHit("runToArray")
	runs := c.runs()
	c.typ = containerArray
	c.mapped = false

	// return early if empty
	if c.n == 0 {
		c.setArray(nil)
		return
	}

	array := make([]uint16, c.n)
	n := int32(0)
	for _, r := range runs {
		for v := int(r.start); v <= int(r.last); v++ {
			array[n] = uint16(v)
			n++
		}
	}
	if roaringParanoia {
		if n != c.n {
			panic("run has fewer bits set than container.n")
		}
	}
	c.setArray(array)
}
738293
func (r *Reply) Array() ([]*Reply, error) {
	if r.Type() == ReplyNil {
		return nil, ErrNil
	}
	if r.Type() != ReplyArray {
		return nil, ErrType
	}
	return r.arrayValue, nil
}
147908
func convertArray(datum interface{}) ([]interface{}, error) {
	arrayValues, ok := datum.([]interface{})
	if ok {
		return arrayValues, nil
	}
	// NOTE: When given a slice of any other type, zip values to
	// items as a convenience to client.
	v := reflect.ValueOf(datum)
	if v.Kind() != reflect.Slice {
		return nil, fmt.Errorf("cannot create []interface{}: expected slice; received: %T", datum)
	}
	// NOTE: Two better alternatives to the current algorithm are:
	//   (1) mutate the reflection tuple underneath to convert the
	//       []int, for example, to []interface{}, with O(1) complexity
	//   (2) use copy builtin to zip the data items over with O(n) complexity,
	//       but more efficient than what's below.
	// Suggestions?
	arrayValues = make([]interface{}, v.Len())
	for idx := 0; idx < v.Len(); idx++ {
		arrayValues[idx] = v.Index(idx).Interface()
	}
	return arrayValues, nil
}
807414
func ArrayToCFArray(a []C.CFTypeRef) C.CFArrayRef {
	var values []unsafe.Pointer
	for _, value := range a {
		values = append(values, unsafe.Pointer(value))
	}
	numValues := len(values)
	var valuesPointer *unsafe.Pointer
	if numValues > 0 {
		valuesPointer = &values[0]
	}
	return C.CFArrayCreate(nil, valuesPointer, C.CFIndex(numValues), &C.kCFTypeArrayCallBacks)
}
1318653
func (em *eventMetadata) writeArray(name string, inType inType, outType outType, tags uint32) {
	em.writeFieldInner(name, inType|inTypeArray, outType, tags, 0)
}
741792
func (env *Environment) GetArray(key string, overrideDefault *[]string) ([]string, error) {
	var oD *string
	if overrideDefault != nil {
		if len(*overrideDefault) > 0 {
			ovr := (*overrideDefault)[0]
			oD = &ovr
		}
	}
	v, e := env.Get(key, oD)
	arr := []string{v}

	if env.supportArrays {
		if strings.Contains(v, ",") {
			arr = strings.Split(v, ",")
		}
	}

	if len(v) > 0 {
		return arr, e
	}
	return []string{}, e
}
95488
func (rb *Bitmap) ToArray() []uint32 {
	array := make([]uint32, rb.GetCardinality())
	pos := 0
	pos2 := 0

	for pos < rb.highlowcontainer.size() {
		hs := uint32(rb.highlowcontainer.getKeyAtIndex(pos)) << 16
		c := rb.highlowcontainer.getContainerAtIndex(pos)
		pos++
		c.fillLeastSignificant16bits(array, pos2, hs)
		pos2 += c.getCardinality()
	}
	return array
}
274303
func FormatIntArray(arr []int64, base int, sep string) string {
	quoted := make([]string, len(arr))
	for i, value := range arr {
		quoted[i] = strconv.FormatInt(value, base)
	}
	return strings.Join(quoted, sep)
}
1241201
func readArray(rd *bufio.Reader) ([]string, error) {
	line, err := rd.ReadString('\n')
	if err != nil {
		return nil, err
	}
	if len(line) < 3 {
		return nil, ErrProtocol
	}

	switch line[0] {
	default:
		return nil, ErrProtocol
	case '*':
		l, err := strconv.Atoi(line[1 : len(line)-2])
		if err != nil {
			return nil, err
		}
		// l can be -1
		var fields []string
		for ; l > 0; l-- {
			s, err := readString(rd)
			if err != nil {
				return nil, err
			}
			fields = append(fields, s)
		}
		return fields, nil
	}
}
661548
func convertArray(in []interface{}) []interface{} {
  rtn := []interface{}{}
  for _, val := range in {
    var newValue interface{}
    switch val.(type) {
      case []interface{}:
        newValue = convertArray(val.([]interface{}))
      case map[interface{}]interface{}:
        newValue = convertMap(val.(map[interface{}]interface{}))
      default:
        newValue = val
    } 
    rtn = append(rtn, newValue)  
  }
  return rtn
}
63792
func (enc *Encoder) Array(v MarshalerJSONArray) {
	if v.IsNil() {
		enc.grow(3)
		r := enc.getPreviousRune()
		if r != '[' {
			enc.writeByte(',')
		}
		enc.writeByte('[')
		enc.writeByte(']')
		return
	}
	enc.grow(100)
	r := enc.getPreviousRune()
	if r != '[' {
		enc.writeByte(',')
	}
	enc.writeByte('[')
	v.MarshalJSONArray(enc)
	enc.writeByte(']')
}
932641
func (enc *Encoder) EncodeArray(v MarshalerJSONArray) error {
	if enc.isPooled == 1 {
		panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
	}
	_, _ = enc.encodeArray(v)
	_, err := enc.Write()
	if err != nil {
		enc.err = err
		return err
	}
	return nil
}
50381
func (nap *NapNap) RunAll(addrs []string) error {
	if len(addrs) == 0 {
		return errors.New("addrs can't be empty")
	}

	wg := &sync.WaitGroup{}

	for _, addr := range addrs {
		wg.Add(1)
		go func(newAddr string) {
			err := http.ListenAndServe(newAddr, nap)
			if err != nil {
				panic(err)
			}
			wg.Done()
		}(addr)
	}

	wg.Wait()
	return nil
}
1057006
func (w *Writer) WriteArray(count int) {
	w.b = AppendArray(w.b, count)
}
314071
func (t Result) Array() []Result {
	if t.Type == Null {
		return []Result{}
	}
	if t.Type != JSON {
		return []Result{t}
	}
	r := t.arrayOrMap('[', false)
	return r.a
}
1232887
func intersectArrayRun(a, b *Container) *Container {
	statsHit("intersect/ArrayRun")
	aa, rb := a.array(), b.runs()
	na, nb := len(aa), len(rb)
	var output []uint16
	for i, j := 0, 0; i < na && j < nb; {
		va, vb := aa[i], rb[j]
		if va < vb.start {
			i++
		} else if va > vb.last {
			j++
		} else {
			output = append(output, va)
			i++
		}
	}
	return NewContainerArray(output)
}
205071
func (d *domainClient) RunScript(ctx context.Context, args *RunScriptArgs) (reply *RunScriptReply, err error) {
	reply = new(RunScriptReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Runtime.runScript", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Runtime.runScript", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Runtime", Op: "RunScript", Err: err}
	}
	return
}