Skip to content

Commit

Permalink
[ISSUE apache#7868] Use entrySet to close channel
Browse files Browse the repository at this point in the history
  • Loading branch information
ChineseTony authored Feb 29, 2024
1 parent 01761bd commit af900e9
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ public void shutdown() {
try {
this.timer.stop();

for (String addr : this.channelTables.keySet()) {
this.channelTables.get(addr).close();
for (Map.Entry<String, ChannelWrapper> channel : this.channelTables.entrySet()) {
channel.getValue().close();
}

this.channelWrapperTables.clear();
Expand Down Expand Up @@ -943,8 +943,9 @@ protected void scanChannelTablesOfNameServer() {
return;
}

for (String addr : this.channelTables.keySet()) {
ChannelWrapper channelWrapper = this.channelTables.get(addr);
for (Map.Entry<String, ChannelWrapper> entry : this.channelTables.entrySet()) {
String addr = entry.getKey();
ChannelWrapper channelWrapper = entry.getValue();
if (channelWrapper == null) {
continue;
}
Expand Down

0 comments on commit af900e9

Please sign in to comment.