// Add adds a new OptionCode key and BinaryMarshaler struct's bytes to the
// Options map.
353032
func (o Options) Add(key OptionCode, value encoding.BinaryMarshaler) error {
	// Special case: since OptionRapidCommit actually has zero length, it is
	// possible for an option key to appear with no value.
	if value == nil {
		o.AddRaw(key, nil)
		return nil
	}

	b, err := value.MarshalBinary()
	if err != nil {
		return err
	}

	o.AddRaw(key, b)
	return nil
}
157765
func (m NiceMD) Add(key string, value string) NiceMD {
	k, v := encodeKeyValue(key, value)
	m[k] = append(m[k], v)
	return m
}
95378
func (m Map) Add(key, value string) {
	m[key] = append(m[key], value)
}
148351
func (f *MinhashLSH) Add(key interface{}, sig []uint64) {
	// Generate hash keys
	Hs := make([]string, f.l)
	for i := 0; i < f.l; i++ {
		Hs[i] = f.hashKeyFunc(sig[i*f.k : (i+1)*f.k])
	}
	// Insert keys into the bootstrapping tables
	for i := range f.initHashTables {
		func(ht initHashTable, hk string, key interface{}) {
			if _, exist := ht[hk]; exist {
				ht[hk] = append(ht[hk], key)
			} else {
				ht[hk] = make(keys, 1)
				ht[hk][0] = key
			}
		}(f.initHashTables[i], Hs[i], key)
	}
}
984781
func (s *store) Add(key string, data interface{}) int {
	s.count++
	return s.root.add(key, data, s.count)
}
322915
func (s *Statement) Add(code ...Code) *Statement {
	*s = append(*s, code...)
	return s
}
507220
func (p Params) Add(k, v string) {
	if param, ok := p[k]; ok {
		switch param.(type) {
		case string:
			param = []string{param.(string), v}
		case []string:
			param = append(param.([]string), v)
		}
		p[k] = param
	} else {
		p[k] = v
	}
}
585880
func (b *Builder) Add(name string, ra io.ReaderAt, size int64, flags Flag) *Builder {
	b.init()

	child := &Entry{
		Name:   name,
		Size:   size,
		Flags:  flags,
		Parent: b.current,

		r: ra,
	}
	b.current.Children = append(b.current.Children, child)

	return b
}
137241
func (s *BinLayoutsStore) Add(ctx context.Context, layout chronograf.Layout) (chronograf.Layout, error) {
	return chronograf.Layout{}, fmt.Errorf("add to BinLayoutsStore not supported")
}
495110
func (b *FooJSONBuilder) Add(info *FooPropertyInfo) *FooJSONBuilder {
	b._properties[info.fieldName] = info
	return b
}
172620
func (c *Client) Add(data interface{}) error {
	c.ensureTransmission()
	c.ensureBuilder()
	return c.builder.Add(data)
}
290966
func (b *Builder) Add(v interface{}) error {
	if it, ok := v.(*ObjectIterator); ok {
		return WithStack(b.AddKeyValuesFromIterator(it))
	}
	if it, ok := v.(*ArrayIterator); ok {
		return WithStack(b.AddValuesFromIterator(it))
	}
	value := NewValue(v)
	if value.IsIllegal() {
		return WithStack(BuilderUnexpectedTypeError{fmt.Sprintf("Cannot convert value of type %s", reflect.TypeOf(v).Name())})
	}
	if err := b.addInternal(value); err != nil {
		return WithStack(err)
	}
	return nil
}
1207575
func (r *configs) Add(configs ...api.Config) {
	r.mu.Lock()
	defer r.mu.Unlock()
	for _, config := range configs {
		r.m[config.ID] = config.Copy()
	}
}
68652
func (bsh *BufferedServerHeader) Add(key string, value string) {
	if bsh.released {
		bsh.original.Set(key, value)
	} else {
		old := []string{}
		if v, found := bsh.headerMap[key]; found {
			old = v
		}
		bsh.headerMap[key] = append(old, value)
	}
}
254042
func (rb *Bitmap) Add(x uint32) {
	hb := highbits(x)
	ra := &rb.highlowcontainer
	i := ra.getIndex(hb)
	if i >= 0 {
		var c container
		c = ra.getWritableContainerAtIndex(i).iaddReturnMinimized(lowbits(x))
		rb.highlowcontainer.setContainerAtIndex(i, c)
	} else {
		newac := newArrayContainer()
		rb.highlowcontainer.insertNewKeyValueAt(-i-1, hb, newac.iaddReturnMinimized(lowbits(x)))
	}
}
1089397
func (t *translator) Add(key interface{}, text string, override bool) error {

	if _, ok := t.translations[key]; ok && !override {
		return &ErrConflictingTranslation{locale: t.Locale(), key: key, text: text}
	}

	lb := strings.Count(text, "{")
	rb := strings.Count(text, "}")

	if lb != rb {
		return &ErrMissingBracket{locale: t.Locale(), key: key, text: text}
	}

	trans := &transText{
		text: text,
	}

	var idx int

	for i := 0; i < lb; i++ {
		s := "{" + strconv.Itoa(i) + "}"
		idx = strings.Index(text, s)
		if idx == -1 {
			return &ErrBadParamSyntax{locale: t.Locale(), param: s, key: key, text: text}
		}

		trans.indexes = append(trans.indexes, idx)
		trans.indexes = append(trans.indexes, idx+len(s))
	}

	t.translations[key] = trans

	return nil
}
991994
func (w *SSTFileWriter) Add(key, value []byte) error {
	cKey := byteToChar(key)
	cValue := byteToChar(value)
	var cErr *C.char
	C.rocksdb_sstfilewriter_add(w.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)), &cErr)
	if cErr != nil {
		defer C.free(unsafe.Pointer(cErr))
		return errors.New(C.GoString(cErr))
	}
	return nil
}