mirror of
https://gitea.elkins.co/Networking/ccl.git
synced 2025-02-04 12:02:47 -06:00
Fix container.Reorder
This commit is contained in:
parent
7cd28a38a2
commit
54b9bae673
@ -34,22 +34,16 @@ const (
|
||||
func Reorder(conts []Container, op operation) {
|
||||
// null orderings go first for either start or stop, as they are executed asynchronously
|
||||
norm := func(a, b Container) bool {
|
||||
if !a.StartOrder.Valid {
|
||||
return true
|
||||
}
|
||||
if !b.StartOrder.Valid {
|
||||
return false
|
||||
}
|
||||
return a.StartOrder.ValueOrZero() < b.StartOrder.ValueOrZero()
|
||||
}
|
||||
rev := func(a, b Container) bool {
|
||||
if !a.StartOrder.Valid {
|
||||
if a.StartOrder.ValueOrZero() == 0 {
|
||||
return true
|
||||
}
|
||||
if !b.StartOrder.Valid {
|
||||
if b.StartOrder.ValueOrZero() == 0 {
|
||||
return false
|
||||
}
|
||||
return b.StartOrder.ValueOrZero() > a.StartOrder.ValueOrZero()
|
||||
return norm(b, a)
|
||||
}
|
||||
var sorter func(a, b Container) bool
|
||||
if op == Start {
|
||||
|
Loading…
x
Reference in New Issue
Block a user