Skip to content

Commit

Permalink
Fix/clarify comment.
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
  • Loading branch information
Raul Gutierrez Segales committed Jul 16, 2018
1 parent 5efbba7 commit 4873108
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/common/upstream/subset_lb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,10 @@ void SubsetLoadBalancer::HostSubsetImpl::update(const HostVector& hosts_added,
}

// Calling predicate() is expensive since it involves metadata lookups; so we
// can take a shortcut and just filter healthy hosts in a follow-up call.
// Ideally, we would merge these two calls.
// avoid it in the 2nd call to filter() by using the result from the first call
// to filter() as the starting point.
//
// TODO(rgs1): merge these two filter() calls in one loop.
HostsPerLocalityConstSharedPtr hosts_per_locality =
original_host_set_.hostsPerLocality().filter(predicate);
HostsPerLocalityConstSharedPtr healthy_hosts_per_locality =
Expand Down

0 comments on commit 4873108

Please sign in to comment.