mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-29 18:09:11 -04:00
Avoid iterating name twice when constructing fctx->info
This is a minor performance improvement, we store the result of the
first call to strlcat to use as an offset in the next call when
constructing fctx->info string.
(cherry picked from commit 49c40827f6)
This commit is contained in:
parent
443e743156
commit
f3bd27373d
1 changed files with 4 additions and 3 deletions
|
|
@ -4936,9 +4936,10 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
|
|||
isc_result_t iresult;
|
||||
isc_interval_t interval;
|
||||
unsigned int findoptions = 0;
|
||||
char buf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE];
|
||||
char buf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE + 1];
|
||||
char typebuf[DNS_RDATATYPE_FORMATSIZE];
|
||||
isc_mem_t *mctx;
|
||||
size_t p;
|
||||
|
||||
/*
|
||||
* Caller must be holding the lock for bucket number 'bucketnum'.
|
||||
|
|
@ -4965,8 +4966,8 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
|
|||
*/
|
||||
dns_name_format(name, buf, sizeof(buf));
|
||||
dns_rdatatype_format(type, typebuf, sizeof(typebuf));
|
||||
strlcat(buf, "/", sizeof(buf));
|
||||
strlcat(buf, typebuf, sizeof(buf));
|
||||
p = strlcat(buf, "/", sizeof(buf));
|
||||
strlcat(buf + p, typebuf, sizeof(buf));
|
||||
fctx->info = isc_mem_strdup(mctx, buf);
|
||||
|
||||
FCTXTRACE("create");
|
||||
|
|
|
|||
Loading…
Reference in a new issue