// ThenByDescending performs a subsequent ordering of the elements in a
// collection in descending order. This method enables you to specify multiple
// sort criteria by applying any number of ThenBy or ThenByDescending methods.
777027
func (oq OrderedQuery) ThenByDescending(selector func(interface{}) interface{}) OrderedQuery {
	return OrderedQuery{
		orders:   append(oq.orders, order{selector: selector, desc: true}),
		original: oq.original,
		Query: Query{
			Iterate: func() Iterator {
				items := oq.original.sort(append(oq.orders, order{selector: selector, desc: true}))
				len := len(items)
				index := 0

				return func() (item interface{}, ok bool) {
					ok = index < len
					if ok {
						item = items[index]
						index++
					}

					return
				}
			},
		},
	}
}
253914
func (s *FieldSort) Order(ascending bool) *FieldSort {
	s.ascending = ascending
	return s
}
263915
func (o *SortOption) By(index int, ascending bool) *SortOption {
	order := instruction.Descending
	if ascending {
		order = instruction.Ascending
	}
	o.orderByList = append(o.orderByList, instruction.OrderBy{
		Index: index,
		Order: order,
	})
	return o
}
1290753
func (api *BridgeAPI) SortByName(reverse bool) *BridgeAPI {
	api.sortByName(reverse)
	return api
}
1126454
func (s *ListOutgoingCertificatesInput) SetAscendingOrder(v bool) *ListOutgoingCertificatesInput {
	s.AscendingOrder = &v
	return s
}
782516
func (s *ListPipelinesInput) SetAscending(v string) *ListPipelinesInput {
	s.Ascending = &v
	return s
}
356026
func (s *ScoreSort) Order(ascending bool) *ScoreSort {
	s.ascending = ascending
	return s
}
669393
func (xmlNode *XmlNode) AddPreviousSibling(data interface{}) (err error) {
	switch t := data.(type) {
	default:
		if nodes, err := xmlNode.coerce(data); err == nil {
			for _, node := range nodes {
				if err = xmlNode.addPreviousSibling(node); err != nil {
					break
				}
			}
		}
	case *DocumentFragment:
		if nodes, err := xmlNode.coerce(data); err == nil {
			for _, node := range nodes {
				if err = xmlNode.addPreviousSibling(node); err != nil {
					break
				}
			}
		}
	case Node:
		err = xmlNode.addPreviousSibling(t)
	}
	return
}
813857
func (s *ListPolicyPrincipalsInput) SetAscendingOrder(v bool) *ListPolicyPrincipalsInput {
	s.AscendingOrder = &v
	return s
}
924346
func (b *SelectBuilder) OrderBy(column string, o Order) *SelectBuilder {
	b.orderBy = append(b.orderBy, column+" "+o.String())
	return b
}
274445
func orderByBindings() ElementHook {
	var f func(st *Statement, ce ConsumedElement) (ElementHook, error)
	f = func(st *Statement, ce ConsumedElement) (ElementHook, error) {
		if ce.IsSymbol() {
			return f, nil
		}
		tkn := ce.Token()
		switch tkn.Type {
		case lexer.ItemBinding:
			st.orderBy = append(st.orderBy, table.SortConfig{{Binding: tkn.Text}}...)
		case lexer.ItemAsc:
			st.orderBy[len(st.orderBy)-1].Desc = false
		case lexer.ItemDesc:
			st.orderBy[len(st.orderBy)-1].Desc = true
		}
		return f, nil
	}
	return f
}
1021410
func (r Rule) ThenDrop() Rule {
	return func(ctx context.Context, e *executor.Event, err error, _ Chain) (context.Context, *executor.Event, error) {
		return r.Eval(ctx, e, err, ChainIdentity)
	}
}
1147757
func (s *SelectStatement) TimeAscending() bool {
	return len(s.SortFields) == 0 || s.SortFields[0].Ascending
}
1062726
func (t *BTree) Ascend(iterator ItemIterator) {
	if t.root == nil {
		return
	}
	t.root.iterate(ascend, nil, nil, false, false, iterator)
}
76433
func (api *RegionAPI) SortByName(reverse bool) *RegionAPI {
	api.sortByName(reverse)
	return api
}
923939
func (xmlNode *XmlNode) PreviousSibling() Node {
	siblingPtr := (*C.xmlNode)(xmlNode.Ptr.prev)
	return NewNode(unsafe.Pointer(siblingPtr), xmlNode.Document)
}
384043
func (h *HTML) nextSibling() jsObject {
	if h == nil || h.node == nil {
		return nil
	}
	return h.node.Get("nextSibling")
}