mirror of
https://github.com/go-gost/x.git
synced 2026-10-21 09:21:09 +00:00
Collapse the separate anyBackupNode scan and partitionByPriority allocation into the single candidate loop. Replace the old short-circuit + tiered logic with four explicit stages: 1. Single-pass candidate scan — priority stats + backup detection 2. Priority short-circuit — top node wins when strictly higher, no backups 3. Uniform fast path — skip sort when all priorities equal (common case) 4. Tiered fallthrough — sort once, feed each priority tier to selector Removes two helper functions and an extra O(n) allocation. Fixes hasBackup to use mdutil.GetBool for consistency with BackupFilter.