mirror of https://github.com/grpc/grpc-java.git
See #11958
This commit is contained in:
parent
2448c8b6b9
commit
666136b4b8
|
|
@ -325,7 +325,11 @@ final class DelayedClientTransport implements ManagedClientTransport {
|
||||||
if (!hasPendingStreams()) {
|
if (!hasPendingStreams()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pendingStreams.removeAll(toRemove);
|
// Avoid pendingStreams.removeAll() as it can degrade to calling toRemove.contains() for each
|
||||||
|
// element in pendingStreams.
|
||||||
|
for (PendingStream stream : toRemove) {
|
||||||
|
pendingStreams.remove(stream);
|
||||||
|
}
|
||||||
// Because delayed transport is long-lived, we take this opportunity to down-size the
|
// Because delayed transport is long-lived, we take this opportunity to down-size the
|
||||||
// hashmap.
|
// hashmap.
|
||||||
if (pendingStreams.isEmpty()) {
|
if (pendingStreams.isEmpty()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue