mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Use dns_fixedname_initname() where possible
Replace dns_fixedname_init() calls followed by dns_fixedname_name() calls with calls to dns_fixedname_initname() where it is possible without affecting current behavior and/or performance. This patch was mostly prepared using Coccinelle and the following semantic patch: @@ expression fixedname, name; @@ - dns_fixedname_init(&fixedname); ... - name = dns_fixedname_name(&fixedname); + name = dns_fixedname_initname(&fixedname); The resulting set of changes was then manually reviewed to exclude false positives and apply minor tweaks. It is likely that more occurrences of this pattern can be refactored in an identical way. This commit only takes care of the low-hanging fruit.
This commit is contained in:
committed by
Ondřej Surý
parent
0d2a03c290
commit
4df4a8e731
@@ -912,8 +912,7 @@ findext(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
||||
olabels = dns_name_countlabels(&db->origin);
|
||||
nlabels = dns_name_countlabels(name);
|
||||
|
||||
dns_fixedname_init(&fname);
|
||||
xname = dns_fixedname_name(&fname);
|
||||
xname = dns_fixedname_initname(&fname);
|
||||
|
||||
if (rdataset == NULL) {
|
||||
dns_rdataset_init(&xrdataset);
|
||||
@@ -1975,8 +1974,7 @@ dns_sdlz_putnamedrr(dns_sdlzallnodes_t *allnodes, const char *name,
|
||||
isc_buffer_t b;
|
||||
isc_result_t result;
|
||||
|
||||
dns_fixedname_init(&fnewname);
|
||||
newname = dns_fixedname_name(&fnewname);
|
||||
newname = dns_fixedname_initname(&fnewname);
|
||||
|
||||
if ((sdlz->dlzimp->flags & DNS_SDLZFLAG_RELATIVERDATA) != 0)
|
||||
origin = &sdlz->common.origin;
|
||||
|
Reference in New Issue
Block a user