// Add will add the provided intervals to this tree.
183348
func (tree *tree) Add(intervals ...Interval) {
	for _, iv := range intervals {
		tree.add(iv)
	}
}
524696
func (g *Grid) Add(e Element, x, y, colSpan, rowSpan int) {
	if x+colSpan > g.cols {
		g.cols = x + colSpan
	}
	if y+rowSpan > g.rows {
		g.rows = y + rowSpan
	}
	g.elts = append(g.elts, &gridElement{e, x, y, colSpan, rowSpan})
}
803440
func (b *MultiErrorBuilder) Add(err error) {
	// Do not add nil values.
	if err == nil {
		return
	}

	b.errors = append(b.errors, err)
}
1241664
func (l *List) Add(i int, n int64) {
	for len := len(l.tree); i < len; i |= i + 1 {
		l.tree[i] += n
	}
}
253716
func (q *Quadtree) add(n *node, p orb.Pointer, point orb.Point, left, right, bottom, top float64) {
	i := 0

	// figure which child of this internal node the point is in.
	if cy := (bottom + top) / 2.0; point[1] <= cy {
		top = cy
		i = 2
	} else {
		bottom = cy
	}

	if cx := (left + right) / 2.0; point[0] >= cx {
		left = cx
		i++
	} else {
		right = cx
	}

	if n.Children[i] == nil {
		n.Children[i] = &node{Value: p}
		return
	}

	// proceed down to the child to see if it's a leaf yet and we can add the pointer there.
	q.add(n.Children[i], p, point, left, right, bottom, top)
}
1369110
func (c *CollisionSystem) Add(basic *ecs.BasicEntity, collision *CollisionComponent, space *SpaceComponent) {
	c.entities = append(c.entities, collisionEntity{basic, collision, space})
}
494463
func (b *Builder) Add(args ...string) error {
	for _, a := range args {
		if err := b.add(a); err != nil {
			return errwrap.Wrapf(fmt.Sprintf("invalid key/value pair %q: {{err}}", a), err)
		}
	}

	return nil
}
903833
func (in *InMemory) Add(sched Schedule, spider Spider) {
	in.AddWithCtx(sched, spider, nil)
}
359170
func (set *Set) Add(items ...interface{}) {
	set.lock.Lock()
	defer set.lock.Unlock()

	set.flattened = nil
	for _, item := range items {
		set.items[item] = struct{}{}
	}
}
631283
func (t *memTombstones) addInterval(ref uint64, itvs ...Interval) {
	t.mtx.Lock()
	defer t.mtx.Unlock()
	for _, itv := range itvs {
		t.intvlGroups[ref] = t.intvlGroups[ref].add(itv)
	}
}
235431
func (g *Noop) Add(ctx context.Context, args ...string) error {
	return nil
}
436663
func (mtt *mttNode) Add(mt *metricType) {
	ns := mt.Namespace()
	node, index := mtt.walk(ns.Strings())
	if index == len(ns) {
		if node.mts == nil {
			node.mts = make(map[int]*metricType)
		}
		node.mts[mt.Version()] = mt
		return
	}
	// walk through the remaining namespace and build out the
	// new branch in the trie.
	for _, n := range ns[index:] {
		if node.children == nil {
			node.children = make(map[string]*mttNode)
		}
		node.children[n.Value] = &mttNode{}
		node = node.children[n.Value]
	}
	node.mts = make(map[int]*metricType)
	node.mts[mt.Version()] = mt
}
131922
func (l *TimeLimiter) Add(d time.Duration) {
	l.add(time.Now(), d)
}
104597
func (t *Timedelta) Add(t2 *Timedelta) Timedelta {
	return Timedelta{
		Days:         t.Days + t2.Days,
		Seconds:      t.Seconds + t2.Seconds,
		Microseconds: t.Microseconds + t2.Microseconds,
		Milliseconds: t.Milliseconds + t2.Milliseconds,
		Minutes:      t.Minutes + t2.Minutes,
		Hours:        t.Hours + t2.Hours,
		Weeks:        t.Weeks + t2.Weeks,
	}
}
1086050
func (s *stringSet) Add(vs ...string) {
	for _, v := range vs {
		s.values[v] = struct{}{}
	}
}
1017776
func (r *Runtime) Add(ctx context.Context, task runtime.Task) error {
	return r.tasks.Add(ctx, task)
}
173673
func (tree *bareTree) add(path string) {
	// if a node already exists under the same path, nothing left to do
	if _, ok := tree.Items[path]; ok {
		return
	}

	pos := strings.LastIndex(path, ".")

	// now walk backwards through the node path to find the first branch which exists that
	// this path extends and add us as a child
	// until then, keep adding new intermediate branches
	prevPos := len(path)
	for pos != -1 {
		branch := path[:pos]
		prevNode := path[pos+1 : prevPos]
		if n, ok := tree.Items[branch]; ok {
			n.Children = append(n.Children, prevNode)
			break
		}

		tree.Items[branch] = &Node{
			Path:     branch,
			Children: []string{prevNode},
		}

		prevPos = pos
		pos = strings.LastIndex(branch, ".")
	}

	if pos == -1 {
		// no existing branches found that match. need to add to the root node.
		branch := path[:prevPos]
		n := tree.Items[""]
		n.Children = append(n.Children, branch)
	}

	// Add leaf node
	tree.Items[path] = &Node{
		Path: path,
		Defs: []schema.MKey{},
	}
}