From 4128822bbf1b06b07a3907549ee6597db3baab6f Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Tue, 24 Apr 2012 23:23:30 +0200 Subject: [PATCH] Faster check --- msg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msg.go b/msg.go index 75d0839f..2da1b391 100644 --- a/msg.go +++ b/msg.go @@ -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 {