Browse Source

Reorder config check before result looping for SRV parsing debug

It isn't needed to iterate over all results if we will be doing nothing
anyhow as it isn't that common to have that debug option enabled.
tags/debian/2.1.7
David Kalnischkies 2 months ago
parent
commit
1bfc0907c9
1 changed files with 6 additions and 11 deletions
  1. +6
    -11
      apt-pkg/contrib/srvrec.cc

+ 6
- 11
apt-pkg/contrib/srvrec.cc View File

@@ -137,17 +137,12 @@ bool GetSrvRecords(std::string name, std::vector<SrvRec> &Result)
// sort them by priority
std::stable_sort(Result.begin(), Result.end());

for(std::vector<SrvRec>::iterator I = Result.begin();
I != Result.end(); ++I)
{
if (_config->FindB("Debug::Acquire::SrvRecs", false) == true)
{
std::cerr << "SrvRecs: got " << I->target
<< " prio: " << I->priority
<< " weight: " << I->weight
<< std::endl;
}
}
if (_config->FindB("Debug::Acquire::SrvRecs", false))
for(auto const &R : Result)
std::cerr << "SrvRecs: got " << R.target
<< " prio: " << R.priority
<< " weight: " << R.weight
<< '\n';

return true;
}


Loading…
Cancel
Save