Index: net/socket/client_socket_pool_base.cc |
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc |
index 0bc0056b8355a6fd2c5a3936dee61222a27076f5..1e92d14c01fe63c042a57c1b5b57303487f45efa 100644 |
--- a/net/socket/client_socket_pool_base.cc |
+++ b/net/socket/client_socket_pool_base.cc |
@@ -572,13 +572,11 @@ LoadState ClientSocketPoolBaseHelper::GetLoadState( |
const Group& group = *group_it->second; |
if (group.HasConnectJobForHandle(handle)) { |
- // Just return the state of the farthest along ConnectJob for the first |
- // group.jobs().size() pending requests. |
- LoadState max_state = LOAD_STATE_IDLE; |
- for (const auto& job : group.jobs()) { |
- max_state = std::max(max_state, job->GetLoadState()); |
- } |
- return max_state; |
+ // Instead of going through all the states in the underlying protocol |
+ // levels, just return the state of the oldest connect job, which is the |
+ // first in the set since the connect jobs are sorted in ascending order |
+ // by time. |
+ return (*group.jobs().begin())->GetLoadState(); |
} |
if (group.CanUseAdditionalSocketSlot(max_sockets_per_group_)) |