raft/auorum: remove unused type

This commit is contained in:
Tobias Schottdorf 2019-07-31 11:39:06 +02:00 committed by Gyuho Lee
parent f786b6ba16
commit 7a50cd7074
2 changed files with 2 additions and 11 deletions

View File

@ -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)

View File

@ -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