Merge branch 'main' into tlim_rtype_61_main

This commit is contained in:
Tom Limoncelli 2025-01-08 11:57:09 -05:00
commit 2e64b668e8
2 changed files with 14 additions and 14 deletions

View file

@ -173,6 +173,7 @@ code to support this provider, we'd be glad to help in any way.
* [Infoblox DNS](https://github.com/StackExchange/dnscontrol/issues/1077) (#1077)
* [Joker.com](https://github.com/StackExchange/dnscontrol/issues/854) (#854)
* [Plesk](https://github.com/StackExchange/dnscontrol/issues/2261) (#2261)
* [Rackspace Cloud DNS](https://github.com/StackExchange/dnscontrol/issues/2980) (#2980)
* [RcodeZero](https://github.com/StackExchange/dnscontrol/issues/884) (#884)
* [SynergyWholesale](https://github.com/StackExchange/dnscontrol/issues/1605) (#1605)
* [UltraDNS by Neustar / CSCGlobal](https://github.com/StackExchange/dnscontrol/issues/1533) (#1533)

View file

@ -27,16 +27,16 @@ func (z *ZoneGenData) Less(i, j int) bool {
// Sort by name.
// If we are at the apex, use "@" in the sorting.
compA, compB := a.NameFQDN, b.NameFQDN
//fmt.Printf("DEBUG: LabelLess(%q, %q) = %v %q %q\n", compA, compB, LabelLess(compA, compB), a.Name, b.Name)
compA, compB := a.NameFQDN, b.NameFQDN
// If we are at the apex, pass "@" to the Less function.
if a.Name == "@" {
compA = "@"
}
if b.Name == "@" {
compB = "@"
}
if compA != compB {
if a.Name == "@" {
compA = "@"
}
if b.Name == "@" {
compB = "@"
}
return LabelLess(compA, compB)
}
@ -132,8 +132,7 @@ func (z *ZoneGenData) Less(i, j int) bool {
func LabelLess(a, b string) bool {
// Compare two zone labels for the purpose of sorting the RRs in a Zone.
// If they are equal, we are done. All other code is simplified
// because we can assume a!=b.
// If they are equal, we are done. The remainingi code can assume a != b.
if a == b {
return false
}
@ -161,15 +160,15 @@ func LabelLess(a, b string) bool {
ia := len(as) - 1
ib := len(bs) - 1
var min int
var minIdx int
if ia < ib {
min = len(as) - 1
minIdx = len(as) - 1
} else {
min = len(bs) - 1
minIdx = len(bs) - 1
}
// Skip the matching highest elements, then compare the next item.
for i, j := ia, ib; min >= 0; i, j, min = i-1, j-1, min-1 {
for i, j := ia, ib; minIdx >= 0; i, j, minIdx = i-1, j-1, minIdx-1 {
// Compare as[i] < bs[j]
// Sort @ at the top, then *, then everything else.
// i.e. @ always is less. * is is less than everything but @.