Use structured bindings in some places:

Most of the new uses either:
* Replace some uses of `tie`
* bind to pairs when iterating through maps
This commit is contained in:
seelabs
2019-08-06 09:11:32 -07:00
parent 9c58f23cf8
commit 7912ee6f7b
66 changed files with 428 additions and 466 deletions

View File

@@ -46,8 +46,8 @@ PerfLogImp::Counters::Counters(std::vector<char const*> const& labels,
rpc_.reserve(labels.size());
for (std::string const label : labels)
{
auto const elem = rpc_.emplace(label, Rpc());
if (!elem.second)
auto const inserted = rpc_.emplace(label, Rpc()).second;
if (!inserted)
{
// Ensure that no other function populates this entry.
assert(false);
@@ -57,10 +57,10 @@ PerfLogImp::Counters::Counters(std::vector<char const*> const& labels,
{
// populateJq
jq_.reserve(jobTypes.size());
for (auto const& job : jobTypes)
for (auto const& [jobType, jobTypeInfo] : jobTypes)
{
auto const elem = jq_.emplace(job.first, Jq(job.second.name()));
if (!elem.second)
auto const inserted = jq_.emplace(jobType, Jq(jobTypeInfo.name())).second;
if (!inserted)
{
// Ensure that no other function populates this entry.
assert(false);