Skip to content

Commit afc9e3b

Browse files
Raúl Gutiérrez SegalésSnow Pettersen
Raúl Gutiérrez Segalés
authored and
Snow Pettersen
committedDec 9, 2019
subset lb: remove outdated TODO comment (envoyproxy#9272)
After @snowp's refactoring to use cached predicates and deal with degraded/excluded hosts, there's no longer a need to merge the previously expensive filter calls. Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
1 parent 8d99679 commit afc9e3b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎source/common/upstream/subset_lb.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,6 @@ void SubsetLoadBalancer::HostSubsetImpl::update(const HostVector& hosts_added,
707707

708708
// If we only have one locality we can avoid the first call to filter() by
709709
// just creating a new HostsPerLocality from the list of all hosts.
710-
//
711-
// TODO(rgs1): merge these two filter() calls in one loop.
712710
HostsPerLocalityConstSharedPtr hosts_per_locality;
713711

714712
if (original_host_set_.hostsPerLocality().get().size() == 1) {
@@ -718,9 +716,9 @@ void SubsetLoadBalancer::HostSubsetImpl::update(const HostVector& hosts_added,
718716
hosts_per_locality = original_host_set_.hostsPerLocality().filter({cached_predicate})[0];
719717
}
720718

721-
HostsPerLocalityConstSharedPtr healthy_hosts_per_locality =
719+
auto healthy_hosts_per_locality =
722720
original_host_set_.healthyHostsPerLocality().filter({cached_predicate})[0];
723-
HostsPerLocalityConstSharedPtr degraded_hosts_per_locality =
721+
auto degraded_hosts_per_locality =
724722
original_host_set_.degradedHostsPerLocality().filter({cached_predicate})[0];
725723
auto excluded_hosts_per_locality =
726724
original_host_set_.excludedHostsPerLocality().filter({cached_predicate})[0];

0 commit comments

Comments
 (0)