Skip to content

Commit

Permalink
fix nits from htuch feedbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Xin Zhuang <stevenzzz@google.com>
  • Loading branch information
stevenzzzz committed Aug 22, 2019
1 parent bf703fc commit 2b375d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/common/router/scoped_rds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ bool ScopedRdsConfigSubscription::addOrUpdateScopes(
// TODO(stevenzzz): Creating a new RdsRouteConfigProvider likely expensive, migrate RDS to
// config-provider-framework to make it light weight.
rds.set_route_config_name(scoped_route_config.route_configuration_name());
// Delete previous route provider if any.
auto rds_config_provider_helper =
std::make_unique<RdsRouteConfigProviderHelper>(*this, scope_name, rds, init_manager);
auto scoped_route_info = std::make_shared<ScopedRouteInfo>(
Expand All @@ -159,6 +158,7 @@ bool ScopedRdsConfigSubscription::addOrUpdateScopes(
iter->second, scoped_route_info->scopeName()));
}
}
// NOTE: delete previous route provider if any.
route_provider_by_scope_.insert({scope_name, std::move(rds_config_provider_helper)});
scope_name_by_hash_[scoped_route_info->scopeKey().hash()] = scoped_route_info->scopeName();
scoped_route_map_[scoped_route_info->scopeName()] = scoped_route_info;
Expand Down Expand Up @@ -285,7 +285,7 @@ void ScopedRdsConfigSubscription::onConfigUpdate(
auto scoped_route = MessageUtil::anyConvert<envoy::api::v2::ScopedRouteConfiguration>(
resource_any, validation_visitor_);
MessageUtil::validate(scoped_route);
const std::string scope_name = scoped_route.name();
const std::string& scope_name = scoped_route.name();
auto scope_config_inserted = scoped_routes.try_emplace(scope_name, std::move(scoped_route));
if (!scope_config_inserted.second) {
throw EnvoyException(
Expand Down

0 comments on commit 2b375d4

Please sign in to comment.