mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft/auorum: remove unused type
This commit is contained in:
parent
f786b6ba16
commit
7a50cd7074
@ -112,9 +112,7 @@ func (c MajorityConfig) Slice() []uint64 {
|
||||
return sl
|
||||
}
|
||||
|
||||
type uint64Slice []uint64
|
||||
|
||||
func insertionSort(sl uint64Slice) {
|
||||
func insertionSort(sl []uint64) {
|
||||
a, b := 0, len(sl)
|
||||
for i := a + 1; i < b; i++ {
|
||||
for j := i; j > a && sl[j] < sl[j-1]; j-- {
|
||||
@ -141,7 +139,7 @@ func (c MajorityConfig) CommittedIndex(l AckedIndexer) Index {
|
||||
// performance is a lesser concern (additionally the performance
|
||||
// implications of an allocation here are far from drastic).
|
||||
var stk [7]uint64
|
||||
srt := uint64Slice(stk[:])
|
||||
srt := []uint64(stk[:])
|
||||
|
||||
if cap(srt) < n {
|
||||
srt = make([]uint64, n)
|
||||
|
@ -25,13 +25,6 @@ func (st StateType) MarshalJSON() ([]byte, error) {
|
||||
return []byte(fmt.Sprintf("%q", st.String())), nil
|
||||
}
|
||||
|
||||
// uint64Slice implements sort interface
|
||||
type uint64Slice []uint64
|
||||
|
||||
func (p uint64Slice) Len() int { return len(p) }
|
||||
func (p uint64Slice) Less(i, j int) bool { return p[i] < p[j] }
|
||||
func (p uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
|
||||
|
||||
func min(a, b uint64) uint64 {
|
||||
if a > b {
|
||||
return b
|
||||
|
Loading…
x
Reference in New Issue
Block a user