2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +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:
Michał Kępień
2018-03-28 14:38:09 +02:00
committed by Ondřej Surý
parent 0d2a03c290
commit 4df4a8e731
86 changed files with 335 additions and 669 deletions

View File

@@ -1803,8 +1803,7 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
return;
}
dns_fixedname_init(&fixname);
name = dns_fixedname_name(&fixname);
name = dns_fixedname_initname(&fixname);
/*
* Iterate over database to fill the new zone.