123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
- // Use of this source code is governed by a MIT license found in the LICENSE file.
- // Code generated from sort-slice.go.tmpl - DO NOT EDIT.
- package codec
- import "time"
- import "reflect"
- import "bytes"
- type stringSlice []string
- func (p stringSlice) Len() int { return len(p) }
- func (p stringSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p stringSlice) Less(i, j int) bool {
- return p[uint(i)] < p[uint(j)]
- }
- type float64Slice []float64
- func (p float64Slice) Len() int { return len(p) }
- func (p float64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p float64Slice) Less(i, j int) bool {
- return p[uint(i)] < p[uint(j)] || isNaN64(p[uint(i)]) && !isNaN64(p[uint(j)])
- }
- type uint64Slice []uint64
- func (p uint64Slice) Len() int { return len(p) }
- func (p uint64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p uint64Slice) Less(i, j int) bool {
- return p[uint(i)] < p[uint(j)]
- }
- type uintptrSlice []uintptr
- func (p uintptrSlice) Len() int { return len(p) }
- func (p uintptrSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p uintptrSlice) Less(i, j int) bool {
- return p[uint(i)] < p[uint(j)]
- }
- type int64Slice []int64
- func (p int64Slice) Len() int { return len(p) }
- func (p int64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p int64Slice) Less(i, j int) bool {
- return p[uint(i)] < p[uint(j)]
- }
- type boolSlice []bool
- func (p boolSlice) Len() int { return len(p) }
- func (p boolSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p boolSlice) Less(i, j int) bool {
- return !p[uint(i)] && p[uint(j)]
- }
- type timeSlice []time.Time
- func (p timeSlice) Len() int { return len(p) }
- func (p timeSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p timeSlice) Less(i, j int) bool {
- return p[uint(i)].Before(p[uint(j)])
- }
- type bytesSlice [][]byte
- func (p bytesSlice) Len() int { return len(p) }
- func (p bytesSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p bytesSlice) Less(i, j int) bool {
- return bytes.Compare(p[uint(i)], p[uint(j)]) == -1
- }
- type stringRv struct {
- v string
- r reflect.Value
- }
- type stringRvSlice []stringRv
- func (p stringRvSlice) Len() int { return len(p) }
- func (p stringRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p stringRvSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v
- }
- type float64Rv struct {
- v float64
- r reflect.Value
- }
- type float64RvSlice []float64Rv
- func (p float64RvSlice) Len() int { return len(p) }
- func (p float64RvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p float64RvSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v || isNaN64(p[uint(i)].v) && !isNaN64(p[uint(j)].v)
- }
- type uint64Rv struct {
- v uint64
- r reflect.Value
- }
- type uint64RvSlice []uint64Rv
- func (p uint64RvSlice) Len() int { return len(p) }
- func (p uint64RvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p uint64RvSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v
- }
- type uintptrRv struct {
- v uintptr
- r reflect.Value
- }
- type uintptrRvSlice []uintptrRv
- func (p uintptrRvSlice) Len() int { return len(p) }
- func (p uintptrRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p uintptrRvSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v
- }
- type int64Rv struct {
- v int64
- r reflect.Value
- }
- type int64RvSlice []int64Rv
- func (p int64RvSlice) Len() int { return len(p) }
- func (p int64RvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p int64RvSlice) Less(i, j int) bool {
- return p[uint(i)].v < p[uint(j)].v
- }
- type boolRv struct {
- v bool
- r reflect.Value
- }
- type boolRvSlice []boolRv
- func (p boolRvSlice) Len() int { return len(p) }
- func (p boolRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p boolRvSlice) Less(i, j int) bool {
- return !p[uint(i)].v && p[uint(j)].v
- }
- type timeRv struct {
- v time.Time
- r reflect.Value
- }
- type timeRvSlice []timeRv
- func (p timeRvSlice) Len() int { return len(p) }
- func (p timeRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p timeRvSlice) Less(i, j int) bool {
- return p[uint(i)].v.Before(p[uint(j)].v)
- }
- type bytesRv struct {
- v []byte
- r reflect.Value
- }
- type bytesRvSlice []bytesRv
- func (p bytesRvSlice) Len() int { return len(p) }
- func (p bytesRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p bytesRvSlice) Less(i, j int) bool {
- return bytes.Compare(p[uint(i)].v, p[uint(j)].v) == -1
- }
- type bytesIntf struct {
- v []byte
- i interface{}
- }
- type bytesIntfSlice []bytesIntf
- func (p bytesIntfSlice) Len() int { return len(p) }
- func (p bytesIntfSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] }
- func (p bytesIntfSlice) Less(i, j int) bool {
- return bytes.Compare(p[uint(i)].v, p[uint(j)].v) == -1
- }
|