mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-02 15:05:16 +00:00
[1688] use BOOST_FOREACH instead of dedicated for loops.
this could be slightly more efficient because it avoids redundant calls to vector::end(). In my experiments I actually didn't see much difference, but it doesn't harm anyway.
This commit is contained in:
@@ -85,21 +85,18 @@ Query::ResponseCreator::create(Message& response,
|
|||||||
assert(added_.empty());
|
assert(added_.empty());
|
||||||
|
|
||||||
// Add the RRsets to the message. The order of sections is important,
|
// Add the RRsets to the message. The order of sections is important,
|
||||||
// as the RRsetInserter remembers RRsets added and will not add
|
// as the ResponseCreator remembers RRsets added and will not add
|
||||||
// duplicates. Adding in the order answer, authory, additional will
|
// duplicates. Adding in the order answer, authory, additional will
|
||||||
// guarantee that if there are duplicates, the single RRset added will
|
// guarantee that if there are duplicates, the single RRset added will
|
||||||
// appear in the most important section.
|
// appear in the most important section.
|
||||||
std::vector<isc::dns::ConstRRsetPtr>::const_iterator i;
|
BOOST_FOREACH(const ConstRRsetPtr& rrset, answers) {
|
||||||
for (i = answers.begin(); i != answers.end(); ++i) {
|
addRRset(response, Message::SECTION_ANSWER, rrset, dnssec);
|
||||||
addRRset(response, Message::SECTION_ANSWER, *i, dnssec);
|
|
||||||
}
|
}
|
||||||
|
BOOST_FOREACH(const ConstRRsetPtr& rrset, authorities) {
|
||||||
for (i = authorities.begin(); i != authorities.end(); ++i) {
|
addRRset(response, Message::SECTION_AUTHORITY, rrset, dnssec);
|
||||||
addRRset(response, Message::SECTION_AUTHORITY, *i, dnssec);
|
|
||||||
}
|
}
|
||||||
|
BOOST_FOREACH(const ConstRRsetPtr& rrset, additionals) {
|
||||||
for (i = additionals.begin(); i != additionals.end(); ++i) {
|
addRRset(response, Message::SECTION_ADDITIONAL, rrset, dnssec);
|
||||||
addRRset(response, Message::SECTION_ADDITIONAL, *i, dnssec);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user