}
func (me *multiLess) Next(f cmper) {
- me.StrictNext(f())
-}
-
-func (me *multiLess) StrictNext(same, less bool) {
if me.ok {
return
}
+ same, less := f()
if same {
return
}
- me.ok, me.less = true, less
+ me.ok = true
+ me.less = less
+}
+
+func (me *multiLess) StrictNext(same, less bool) {
+ if me.ok {
+ return
+ }
+ me.Next(func() (bool, bool) { return same, less })
}
func (me *multiLess) NextBool(l, r bool) {
ml.StrictNext(
l.completedHandshake.Equal(r.completedHandshake),
l.completedHandshake.Before(r.completedHandshake))
- ml.StrictNext(l.peerPriority() == r.peerPriority(), l.peerPriority() < r.peerPriority())
+ ml.Next(func() (bool, bool) {
+ return l.peerPriority() == r.peerPriority(), l.peerPriority() < r.peerPriority()
+ })
ml.StrictNext(l == r, uintptr(unsafe.Pointer(l)) < uintptr(unsafe.Pointer(r)))
less, ok := ml.FinalOk()
if !ok {