Fix closest encloser

This commit is contained in:
Miek Gieben
2016-03-30 20:13:48 +01:00
parent bf6d90600b
commit 8feef98188
4 changed files with 58 additions and 17 deletions

View File

@@ -8,10 +8,10 @@ import (
// Less returns <0 when a is less than b, 0 when they are equal and
// >0 when a is larger than b.
// The function order names in DNSSEC canonical order.
// The function orders names in DNSSEC canonical order: RFC 4034s section-6.1
//
// See http://bert-hubert.blogspot.co.uk/2015/10/how-to-do-fast-canonical-ordering-of.html
// for a blog article on how we do this. And https://tools.ietf.org/html/rfc4034#section-6.1 .
// for a blog article on this implementation:
func Less(a, b string) int {
i := 1
aj := len(a)