// Prev returns the previous Page relative to the given Page in
// this weighted page set.
152
func (wp WeightedPages) Prev(cur Page) Page {
	for x, c := range wp {
		if c.Page == cur {
			if x == 0 {
				return wp[len(wp)-1].Page
			}
			return wp[x-1].Page
		}
	}
	return nil
}
641136
func (pr *PagingResult) Next() (noMore bool, err error) {
	if !pr.HasNext() {
		noMore = true
		return
	}

	return pr.navigate(&pr.next)
}
1140220
func (e *CElement) PrevWaitChan() <-chan struct{} {
	e.mtx.RLock()
	defer e.mtx.RUnlock()

	return e.prevWaitCh
}
1332091
func (c *ReactionsListCall) Page(page int) *ReactionsListCall {
	c.page = page
	return c
}
972462
func (d Data) Pages() Pages {
	v, found := d["pages"]
	if !found {
		return nil
	}

	switch vv := v.(type) {
	case Pages:
		return vv
	case func() Pages:
		return vv()
	default:
		panic(fmt.Sprintf("%T is not Pages", v))
	}
}
1294553
func (s *IPCredentialList) FirstPage() (*IPCredentialList, error) {
	return s.getPage(s.Meta.FirstPageUri)
}
1372268
func (e *ByteIntervalElement) Prev() *ByteIntervalElement {
	if p := e.prev; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
264597
func (p Pos) Before(u Pos) bool {
	return u.Offset > p.Offset || u.Line > p.Line
}
422669
func (s *IPServiceList) LastPage() (*IPServiceList, error) {
	return s.getPage(s.Meta.LastPageUri)
}
793714
func (e *CElement) SetPrev(newPrev *CElement) {
	e.mtx.Lock()

	oldPrev := e.prev
	e.prev = newPrev
	if oldPrev != nil && newPrev == nil {
		e.prevWg = waitGroup1() // WaitGroups are difficult to re-use.
		e.prevWaitCh = make(chan struct{})
	}
	if oldPrev == nil && newPrev != nil {
		e.prevWg.Done()
		close(e.prevWaitCh)
	}
	e.mtx.Unlock()
}
1283440
func (cm *ProtoConsumerMessage) GetPrevValue(msg proto.Message) (prevValueExist bool, err error) {
	prevVal := cm.ConsumerMessage.GetPrevValue()
	if prevVal == nil {
		return false, nil
	}
	err = cm.serializer.Unmarshal(prevVal, msg)
	if err != nil {
		return true, err
	}
	return true, nil
}
211513
func (e *Event) GetPreviousValue(keys ...string) string {
	return getValue(e.Data.PreviousAttributes, keys)
}
338788
func (l Links) CurrentPage() (int, error) {
	switch {
	case l.Previous == "" && l.Next != "":
		return 1, nil
	case l.Previous != "":
		prevPage, err := pageForURL(l.Previous)
		if err != nil {
			return 0, err
		}

		return prevPage + 1, nil
	}
	return 0, nil
}
562145
func (e *Element) Prev() *Element {
	if p := e.prev; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
901391
func (c *IPMemberList) LastPage() (*IPMemberList, error) {
	return c.getPage(c.Meta.LastPageUri)
}
756049
func (c *cursor) Prev() bool {
	// Ensure transaction state is valid.
	if err := c.bucket.tx.checkClosed(); err != nil {
		return false
	}

	// Nothing to return if cursor is exhausted.
	if c.currentIter == nil {
		return false
	}

	// Move the current iterator to the previous entry and choose the
	// iterator that is both valid and has the larger key.
	c.currentIter.Prev()
	return c.chooseIterator(false)
}
9739
func (c *Cursor) PreviousLine(n int) {
	fmt.Fprintf(c.Out, "\x1b[%dF", n)
}