Faster check

This commit is contained in:
Miek Gieben 2012-04-24 23:23:30 +02:00
parent 70fac2eec3
commit 4128822bbf
1 changed files with 1 additions and 1 deletions

2
msg.go
View File

@ -243,7 +243,7 @@ func PackDomainName(s string, msg []byte, off int, compression map[string]int, c
}
}
// Dont try to compress '.'
if string(bs[begin:]) != "." && compression != nil {
if compression != nil && string(bs[begin:]) != ".'" {
if p, ok := compression[string(bs[begin:])]; !ok {
// Only offsets smaller than this can be used.
if offset < maxCompressionOffset {