mirror of
https://github.com/luxfi/utxo.git
synced 2026-07-27 03:39:23 +00:00
- SA1019: math.Mul64/Add64 -> generic math.Mul/Add (ed25519fx, mldsafx, schnorrfx inputs; flow_checker; utxo_fetching); prefixdb.NewNested -> New (alias) - unused: DELETE dead codecVersion const (last codec reference in utxo — full ZAP native now), isSortedAndUniqueOrdered (root + secp256k1fx), mldsafx Keychain.get, and all 6 redundant TransferOutput.isState() markers (the embedded verify.IsState already provides State membership) - QF1008: drop embedded-field selectors (utxo_wire, ed25519fx, nftfx, propertyfx + tests); ST1005: lowercase Schnorr error string Behavior-identical; 11/11 packages pass. Co-authored-by: Hanzo Dev <dev@hanzo.ai>
24 lines
458 B
Go
24 lines
458 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package utxo
|
|
|
|
import (
|
|
"slices"
|
|
)
|
|
|
|
func sortByCompare[T interface{ Compare(T) int }](s []T) {
|
|
slices.SortFunc(s, func(a, b T) int {
|
|
return a.Compare(b)
|
|
})
|
|
}
|
|
|
|
func isSortedAndUniqueByCompare[T interface{ Compare(T) int }](s []T) bool {
|
|
for i := 1; i < len(s); i++ {
|
|
if s[i-1].Compare(s[i]) >= 0 {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|