// ArrayKeyOmitEmpty adds an array or slice to be encoded and skips if it is nil.
// Must be called inside an object as it will encode a key.
514429
func (enc *Encoder) ArrayKeyOmitEmpty(key string, v MarshalerJSONArray) {
	if enc.hasKeys {
		if !enc.keyExists(key) {
			return
		}
	}
	if v.IsNil() {
		return
	}
	enc.grow(5 + len(key))
	r := enc.getPreviousRune()
	if r != '{' {
		enc.writeByte(',')
	}
	enc.writeByte('"')
	enc.writeStringEscape(key)
	enc.writeBytes(objKeyArr)
	v.MarshalJSONArray(enc)
	enc.writeByte(']')
}
155544
func (that *JSONNode) atArray(key int, val ...interface{}) *JSONNode {
	if that.t == TypeUndefined {
		that.t = TypeArray
	} else if that.t != TypeArray {
		panic(ErrorMultipleType)
	}
	if key < 0 {
		panic(ErrorArrayNegativeValue)
	}
	if key >= len(that.a) {
		newa := make([]JSONNode, key+1)
		for i := 0; i < len(that.a); i++ {
			newa[i] = that.a[i]
		}
		that.a = newa
	}
	return that.a[key].At(val...)
}
847375
func (enc *Encoder) AddFloat32KeyOmitEmpty(key string, v float32) {
	enc.Float32KeyOmitEmpty(key, v)
}
854771
func (sig *Signature) KeyExpired(currentTime time.Time) bool {
	if sig.KeyLifetimeSecs == nil {
		return false
	}
	expiry := sig.CreationTime.Add(time.Duration(*sig.KeyLifetimeSecs) * time.Second)
	return currentTime.After(expiry)
}
637553
func (enc *Encoder) SQLNullBoolKeyOmitEmpty(key string, v *sql.NullBool) {
	if v != nil && v.Valid && v.Bool != false {
		enc.BoolKeyOmitEmpty(key, v.Bool)
	}
}
982560
func (enc *Encoder) SQLNullInt64OmitEmpty(v *sql.NullInt64) {
	if v != nil && v.Valid && v.Int64 != 0 {
		enc.Int64(v.Int64)
	}
}
383715
func (enc *Encoder) SQLNullFloat64OmitEmpty(v *sql.NullFloat64) {
	if v != nil && v.Valid && v.Float64 != 0 {
		enc.Float64(v.Float64)
	}
}
1292710
func DropKeys(keyvals []interface{}, dropKeyValPredicate func(key, value interface{}) bool) []interface{} {
	keyvalsDropped := make([]interface{}, 0, len(keyvals))
	for i := 0; i < 2*(len(keyvals)/2); i += 2 {
		if !dropKeyValPredicate(keyvals[i], keyvals[i+1]) {
			keyvalsDropped = append(keyvalsDropped, keyvals[i], keyvals[i+1])
		}
	}
	return keyvalsDropped
}
772437
func (enc *Encoder) ArrayNullEmpty(v MarshalerJSONArray) {
	enc.grow(4)
	r := enc.getPreviousRune()
	if r != '[' {
		enc.writeByte(',')
	}
	if v.IsNil() {
		enc.writeBytes(nullBytes)
		return
	}
	enc.writeByte('[')
	v.MarshalJSONArray(enc)
	enc.writeByte(']')
}
452404
func (enc *Encoder) AddStringKeyOmitEmpty(key, v string) {
	enc.StringKeyOmitEmpty(key, v)
}
1359326
func (enc *Encoder) StringOmitEmpty(v string) {
	if v == "" {
		return
	}
	r := enc.getPreviousRune()
	if r != '[' {
		enc.writeTwoBytes(',', '"')
	} else {
		enc.writeByte('"')
	}
	enc.writeStringEscape(v)
	enc.writeByte('"')
}
418822
func (b *Builder) closeEmptyArrayOrObject(tos ValueLength, isArray bool) {
	// empty Array or Object
	if isArray {
		b.buf[tos] = 0x01
	} else {
		b.buf[tos] = 0x0a
	}
	vpackAssert(b.buf.Len() == tos+9)
	b.buf.Shrink(8)
	b.stack.Pop()
}
647501
func UintArray(name string, values []uint) FieldOpt {
	inType := inTypeNull
	var writeItem func(*eventData, uint)
	switch unsafe.Sizeof(values[0]) {
	case 4:
		inType = inTypeUint32
		writeItem = func(ed *eventData, item uint) { ed.writeUint32(uint32(item)) }
	case 8:
		inType = inTypeUint64
		writeItem = func(ed *eventData, item uint) { ed.writeUint64(uint64(item)) }
	default:
		panic("Unsupported uint size")
	}

	return func(em *eventMetadata, ed *eventData) {
		em.writeArray(name, inType, outTypeDefault, 0)
		ed.writeUint16(uint16(len(values)))
		for _, v := range values {
			writeItem(ed, v)
		}
	}
}
737492
func (enc *Encoder) AddUint64KeyOmitEmpty(key string, v uint64) {
	enc.Uint64KeyOmitEmpty(key, v)
}
668569
func (c *SSHCommand) writeTemporaryKey(name string, data []byte) (string, error, func() error) {
	return c.writeTemporaryFile(name, data, 0600)
}
1122190
func (enc *Encoder) AddInt32KeyOmitEmpty(key string, v int32) {
	enc.Int64KeyOmitEmpty(key, int64(v))
}
273433
func (enc *Encoder) Uint16KeyNullEmpty(key string, v uint16) {
	enc.Uint64KeyNullEmpty(key, uint64(v))
}