Skip to content

Commit

Permalink
re-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Menno Pruijssers committed Dec 19, 2016
1 parent 78eaa44 commit 94b1898
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions hashring/hashring.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ type replicaPoint struct {

func (r replicaPoint) Compare(other interface{}) (result int) {
o := other.(replicaPoint)

result = r.hash - o.hash
if result == 0 {
result = strings.Compare(r.address, o.address)
if result != 0 {
return
}

if result == 0 {
result = r.index - o.index
result = strings.Compare(r.address, o.address)
if result != 0 {
return
}

return result
result = r.index - o.index
return
}

// HashRing stores strings on a consistent hash ring. HashRing internally uses
Expand Down

0 comments on commit 94b1898

Please sign in to comment.