Skip to content

Commit

Permalink
Some small improvements (netty#11564)
Browse files Browse the repository at this point in the history
Signed-off-by: xingrufei <xingrufei@sogou-inc.com>
  • Loading branch information
skyguard1 authored and laosijikaichele committed Dec 16, 2021
1 parent 51e9be2 commit 0bf0d31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Expand Up @@ -410,7 +410,7 @@ public void incrementFlowControlWindows(int delta) throws Http2Exception {

window += delta;
processedWindow += delta;
lowerBound = delta < 0 ? delta : 0;
lowerBound = Math.min(delta, 0);
}

@Override
Expand Down
Expand Up @@ -128,7 +128,7 @@ public boolean prepareUpgradeResponse(ChannelHandlerContext ctx, FullHttpRequest
// 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.");
}
Expand Down
Expand Up @@ -111,7 +111,7 @@ private static HostsFileEntries hostsFileEntries(HostsFileEntriesProvider provid
}

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()) {
Expand Down

0 comments on commit 0bf0d31

Please sign in to comment.