Some small improvements (#11564)
Signed-off-by: xingrufei <xingrufei@sogou-inc.com>
This commit is contained in:
parent
3f8dab5ad0
commit
3c27e008b6
@ -410,7 +410,7 @@ public class DefaultHttp2LocalFlowController implements Http2LocalFlowController
|
||||
|
||||
window += delta;
|
||||
processedWindow += delta;
|
||||
lowerBound = delta < 0 ? delta : 0;
|
||||
lowerBound = Math.min(delta, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -128,7 +128,7 @@ public class Http2ServerUpgradeCodec implements HttpServerUpgradeHandler.Upgrade
|
||||
// Decode the HTTP2-Settings header and set the settings on the handler to make
|
||||
// sure everything is fine with the request.
|
||||
List<String> upgradeHeaders = upgradeRequest.headers().getAll(HTTP_UPGRADE_SETTINGS_HEADER);
|
||||
if (upgradeHeaders.isEmpty() || upgradeHeaders.size() > 1) {
|
||||
if (upgradeHeaders.size() != 1) {
|
||||
throw new IllegalArgumentException("There must be 1 and only 1 "
|
||||
+ HTTP_UPGRADE_SETTINGS_HEADER + " header.");
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ public final class HostsFileParser {
|
||||
}
|
||||
|
||||
private static Map<String, ?> toMapWithSingleValue(Map<String, List<InetAddress>> fromMapWithListValue) {
|
||||
Map<String, InetAddress> result = new HashMap<String, InetAddress>();
|
||||
Map<String, InetAddress> result = new HashMap<String, InetAddress>(fromMapWithListValue.size());
|
||||
for (Map.Entry<String, List<InetAddress>> entry : fromMapWithListValue.entrySet()) {
|
||||
List<InetAddress> value = entry.getValue();
|
||||
if (!value.isEmpty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user