From ca509c1453c4e5d70484763a5784fbfeed11b324 Mon Sep 17 00:00:00 2001 From: Donna Dionne Date: Mon, 27 Jul 2020 09:37:39 -0700 Subject: [PATCH] Fixing a member var to not be a reference. --- .../filters/client_channel/lb_policy/xds/xds_routing.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc index 2adc7cd9551..1a70df4b71c 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc @@ -185,7 +185,7 @@ class XdsRoutingLb : public LoadBalancingPolicy { RefCountedPtr xds_routing_policy_; // Points to the corresponding key in XdsRoutingLb::actions_. - const std::string& name_; + const std::string name_; OrphanablePtr child_policy_; @@ -405,9 +405,10 @@ void XdsRoutingLb::UpdateLocked(UpdateArgs args) { const RefCountedPtr& config = p.second; auto it = actions_.find(name); if (it == actions_.end()) { - it = actions_.emplace(std::make_pair(name, nullptr)).first; - it->second = MakeOrphanable( - Ref(DEBUG_LOCATION, "XdsRoutingChild"), it->first); + it = actions_ + .emplace(name, MakeOrphanable( + Ref(DEBUG_LOCATION, "XdsRoutingChild"), name)) + .first; } it->second->UpdateLocked(config, args.addresses, args.args); }