// Set sets the value associated with k.
776484
func (t *PrimaryTree) Set(k string, v SecondaryLayer) {
	//dbg("--- PRE Set(%v, %v)\n%s", k, v, t.dump())
	//defer func() {
	//	dbg("--- POST\n%s\n====\n", t.dump())
	//}()

	pi := -1
	var p *x1
	q := t.r
	if q == nil {
		z := t.insert(btDPool1.Get().(*d1), 0, k, v)
		t.r, t.first, t.last = z, z, z
		return
	}

	for {
		i, ok := t.find(q, k)
		if ok {
			switch x := q.(type) {
			case *x1:
				if x.c > 2*kx1 {
					x, i = t.splitX(p, x, pi, i)
				}
				pi = i + 1
				p = x
				q = x.x[i+1].ch
				continue
			case *d1:
				x.d[i].v = v
			}
			return
		}

		switch x := q.(type) {
		case *x1:
			if x.c > 2*kx1 {
				x, i = t.splitX(p, x, pi, i)
			}
			pi = i
			p = x
			q = x.x[i].ch
		case *d1:
			switch {
			case x.c < 2*kd1:
				t.insert(x, i, k, v)
			default:
				t.overflow(p, x, pi, i, k, v)
			}
			return
		}
	}
}
921464
func (s *StringValue) Set(val string) error {
	*s = StringValue(val)
	return nil
}
607474
func (ai *AtomicInt) Set(newValue int) {
	atomic.StoreInt64(&ai.val, int64(newValue))
}
674374
func (p *KVParam) Set(s string) error {
	sep := p.sep()

	parts := strings.Split(s, sep)
	if len(parts) != len(p.keys) {
		return trace.Errorf(
			"expected elements separated by '%v', got '%v'", sep, s)
	}
	values := make([]Param, len(p.keys))
	for i, pt := range parts {
		el := p.keys[i].New()
		if err := el.Set(pt); err != nil {
			return err
		}
		values[i] = el
	}

	p.values = values
	return nil
}
312712
func (s setMap) Set(key string, value interface{}) {
	if reflect.ValueOf(value).IsNil() {
		return
	}

	s[key] = value
}
874956
func (r *Store) Set(key string, value interface{}) (Entry, bool) {
	return r.Save(key, value, false)
}
168729
func (k *ArrayKeyring) Set(i Item) error {
	if k.items == nil {
		k.items = map[string]Item{}
	}
	k.items[i.Key] = i
	return nil
}
579991
func (c *Context) Set(key string, value interface{}) {
	c.Context = context.WithValue(c.Context, key, value)
}
457398
func (f *Strings) Set(i string) error {
	*f = append(*f, i)
	return nil
}
917855
func (i *KSUID) Set(s string) error {
	return i.UnmarshalText([]byte(s))
}
832249
func (m *lockingMap) Set(key string, val interface{}) {
	m.keyLocker.Lock(key)
	defer m.keyLocker.Unlock(key)

	m.lock.Lock()
	defer m.lock.Unlock()

	m.data[key] = val
}
319563
func (s *SyncString) Set(v string) {
	s.Lock()
	defer s.Unlock()
	s.string = v
}
1052847
func (i18 *I18Mem) Set(values map[string]string) {
	i18.muTranlsates.Lock()
	defer i18.muTranlsates.Unlock()
	for key, value := range values {
		i18.translates[key] = value
	}
}
605728
func (st *TxnState) Set(k kv.Key, v []byte) error {
	return st.buf.Set(k, v)
}
471084
func (md MD) Set(k string, vals ...string) {
	if len(vals) == 0 {
		return
	}
	k = strings.ToLower(k)
	md[k] = vals
}
188283
func (rkv *KeyValue) Set(key, value string) error {
	conn := rkv.pool.Get(rkv.dbindex)
	_, err := conn.Do("SET", rkv.id+":"+key, value)
	return err
}
472967
func (c *rpcLabels) Set(key, val string) {
	*c = append(*c, data.Option{Name: key, Value: val})
}