mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 10:59:59 -04:00
simplify iterator_active()
the if statements calling iterator_active() checked the EXISTS flag on the header and then iterator_active() checked it again. simplify so only the caller checks it.
This commit is contained in:
parent
d7801aec71
commit
04d6412558
1 changed files with 6 additions and 11 deletions
|
|
@ -3316,13 +3316,6 @@ iterator_active(qpcache_t *qpdb, qpc_rditer_t *iterator,
|
|||
dns_slabheader_t *header) {
|
||||
dns_ttl_t stale_ttl = header->expire + STALE_TTL(header, qpdb);
|
||||
|
||||
/*
|
||||
* Is this a "this rdataset doesn't exist" record?
|
||||
*/
|
||||
if (!EXISTS(header)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* If this header is still active then return it.
|
||||
*/
|
||||
|
|
@ -3352,8 +3345,9 @@ rdatasetiter_first(dns_rdatasetiter_t *it DNS__DB_FLARG) {
|
|||
NODE_RDLOCK(nlock, &nlocktype);
|
||||
|
||||
for (top = qpnode->data; top != NULL; top = top->next) {
|
||||
if ((EXPIREDOK(iterator) && EXISTS(top->header)) ||
|
||||
iterator_active(qpdb, iterator, top->header))
|
||||
if (EXISTS(top->header) &&
|
||||
(EXPIREDOK(iterator) ||
|
||||
iterator_active(qpdb, iterator, top->header)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -3387,8 +3381,9 @@ rdatasetiter_next(dns_rdatasetiter_t *it DNS__DB_FLARG) {
|
|||
NODE_RDLOCK(nlock, &nlocktype);
|
||||
|
||||
for (top = top->next; top != NULL; top = top->next) {
|
||||
if ((EXPIREDOK(iterator) && EXISTS(top->header)) ||
|
||||
iterator_active(qpdb, iterator, top->header))
|
||||
if (EXISTS(top->header) &&
|
||||
(EXPIREDOK(iterator) ||
|
||||
iterator_active(qpdb, iterator, top->header)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue