From 82ecc44b96189ba24628d4e045deff2a85d923a1 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Sat, 10 Feb 2001 02:55:05 +0000 Subject: [PATCH] another micro-optimization. --- lib/dns/compress.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/dns/compress.c b/lib/dns/compress.c index 46d05780fc..faacf3d730 100644 --- a/lib/dns/compress.c +++ b/lib/dns/compress.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: compress.c,v 1.46 2001/02/10 01:18:19 bwelling Exp $ */ +/* $Id: compress.c,v 1.47 2001/02/10 02:55:05 bwelling Exp $ */ #define DNS_NAME_USEINLINE 1 @@ -154,8 +154,13 @@ dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name, if (node == NULL) return (ISC_FALSE); - dns_name_clone(&tname, suffix); - dns_name_getlabelsequence(name, 0, n, prefix); + if (n == 0) { + dns_name_clone(name, suffix); + dns_name_reset(prefix); + } else { + dns_name_clone(&tname, suffix); + dns_name_getlabelsequence(name, 0, n, prefix); + } *offset = node->offset; return (ISC_TRUE); }