// MoveBefore moves element e to its new position before mark.
// If e or mark is not an element of l, or e == mark, the list is not modified.
// The element and mark must not be nil.
433748
func (l *PacketIntervalList) MoveBefore(e, mark *PacketIntervalElement) {
	if e.list != l || e == mark || mark.list != l {
		return
	}
	l.insert(l.remove(e), mark.prev)
}
635469
func WrapBefore(handler http.Handler) HandlerFunc {
	return func(ctx *Context) {
		handler.ServeHTTP(ctx.ResponseWriter, ctx.Req())

		ctx.Next()
	}
}
671466
func (l *List) MoveToBack(e *Element) {
	if e.list != l || l.root.prev == e {
		return
	}
	// see comment in List.Remove about initialization of l
	l.insert(l.remove(e), l.root.prev)
}
328460
func (tr Ranges) findFirstNotBefore(r Range) *list.Element {
	if tr.sortedRanges == nil {
		return nil
	}
	for e := tr.sortedRanges.Front(); e != nil; e = e.Next() {
		if !e.Value.(Range).Before(r) {
			return e
		}
	}
	return nil
}
332432
func isBefore(key, max []byte) bool {
	return key != nil && bytes.Compare(key, max) <= 0
}
588268
func (s *CertificateValidity) SetNotBefore(v time.Time) *CertificateValidity {
	s.NotBefore = &v
	return s
}
434123
func (l *list) MoveAfter(e, mark *element) {
	if e.list != l || e == mark {
		return
	}
	l.insert(l.remove(e), mark)
}
1128053
func (l *PacketList) InsertBefore(v Packet, mark *PacketElement) *PacketElement {
	if mark.list != l {
		return nil
	}
	// see comment in List.Remove about initialization of l
	return l.insertValue(v, mark.prev)
}
53399
func (l *PacketList) MoveToBack(e *PacketElement) {
	if e.list != l || l.root.prev == e {
		return
	}
	// see comment in List.Remove about initialization of l
	l.insert(l.remove(e), l.root.prev)
}
1144937
func (s *Action) GitCredentialBefore(ctx context.Context, c *cli.Context) error {
	err := s.Initialized(ctx, c)
	if err != nil {
		return err
	}
	if !ctxutil.IsStdin(ctx) {
		return ExitError(ctx, ExitUsage, nil, "missing stdin from git")
	}
	return nil
}
178509
func (l *List) MoveToFront(e *Element) {
	if e.list != l || l.root.next == e {
		return
	}
	// see comment in List.Remove about initialization of l
	l.insert(l.remove(e), &l.root)
}
309240
func WalkBeforeAndAfter(v BeforeAndAfterVisitor, x interface{}) {
	v.Before(x)
	defer v.After(x)
	w := v.Visit(x)
	if w == nil {
		return
	}
	switch x := x.(type) {
	case *Module:
		Walk(w, x.Package)
		for _, i := range x.Imports {
			Walk(w, i)
		}
		for _, r := range x.Rules {
			Walk(w, r)
		}
		for _, c := range x.Comments {
			Walk(w, c)
		}
	case *Package:
		Walk(w, x.Path)
	case *Import:
		Walk(w, x.Path)
		Walk(w, x.Alias)
	case *Rule:
		Walk(w, x.Head)
		Walk(w, x.Body)
		if x.Else != nil {
			Walk(w, x.Else)
		}
	case *Head:
		Walk(w, x.Name)
		Walk(w, x.Args)
		if x.Key != nil {
			Walk(w, x.Key)
		}
		if x.Value != nil {
			Walk(w, x.Value)
		}
	case Body:
		for _, e := range x {
			Walk(w, e)
		}
	case Args:
		for _, t := range x {
			Walk(w, t)
		}
	case *Expr:
		switch ts := x.Terms.(type) {
		case []*Term:
			for _, t := range ts {
				Walk(w, t)
			}
		case *Term:
			Walk(w, ts)
		}
		for i := range x.With {
			Walk(w, x.With[i])
		}
	case *With:
		Walk(w, x.Target)
		Walk(w, x.Value)
	case *Term:
		Walk(w, x.Value)
	case Ref:
		for _, t := range x {
			Walk(w, t)
		}
	case Object:
		x.Foreach(func(k, v *Term) {
			Walk(w, k)
			Walk(w, v)
		})
	case Array:
		for _, t := range x {
			Walk(w, t)
		}
	case Set:
		x.Foreach(func(t *Term) {
			Walk(w, t)
		})
	case *ArrayComprehension:
		Walk(w, x.Term)
		Walk(w, x.Body)
	case *ObjectComprehension:
		Walk(w, x.Key)
		Walk(w, x.Value)
		Walk(w, x.Body)
	case *SetComprehension:
		Walk(w, x.Term)
		Walk(w, x.Body)
	case Call:
		for _, t := range x {
			Walk(w, t)
		}
	}
}
180090
func (l *ByteIntervalList) MoveAfter(e, mark *ByteIntervalElement) {
	if e.list != l || e == mark || mark.list != l {
		return
	}
	l.insert(l.remove(e), mark)
}
1359243
func (l *waiterList) InsertBefore(a, e *Entry) {
	b := waiterElementMapper{}.linkerFor(a).Prev()
	waiterElementMapper{}.linkerFor(e).SetNext(a)
	waiterElementMapper{}.linkerFor(e).SetPrev(b)
	waiterElementMapper{}.linkerFor(a).SetPrev(e)

	if b != nil {
		waiterElementMapper{}.linkerFor(b).SetNext(e)
	} else {
		l.head = e
	}
}
308753
func (c *CheckSuite) GetBeforeSHA() string {
	if c == nil || c.BeforeSHA == nil {
		return ""
	}
	return *c.BeforeSHA
}
1332139
func (a *ActDepend) OverrideBefore(index int, fx func(b interface{}, a ActionInterface)) ActionInterface {
	ind, ok := a.correctIndex(index)

	if !ok {
		return a
	}

	ax := a.waiters[ind]

	var dx ActionInterface

	if ind < 1 {
		dx = a.root
	} else {
		dx = a.waiters[ind-1]
	}

	if _, ok := a.states[ind]; ok {
		a.states[ind] = true
	}

	return dx.UseThen(fx, ax)
}
356195
func (slist *syncedList) InsertBefore(
	v interface{}, mark *list.Element) *list.Element {

	slist.Lock()
	defer slist.Unlock()

	return slist.queue.InsertBefore(v, mark)
}