作者 crossoverJie

:art: 改进代码的结构/格式

@@ -39,7 +39,6 @@ public class HeartBeatServer { @@ -39,7 +39,6 @@ public class HeartBeatServer {
39 @Value("${netty.server.port}") 39 @Value("${netty.server.port}")
40 private int nettyPort; 40 private int nettyPort;
41 41
42 - private NioServerSocketChannel channel;  
43 42
44 /** 43 /**
45 * 启动 Netty 44 * 启动 Netty
@@ -62,7 +61,6 @@ public class HeartBeatServer { @@ -62,7 +61,6 @@ public class HeartBeatServer {
62 if (future.isSuccess()) { 61 if (future.isSuccess()) {
63 LOGGER.info("启动 Netty 成功"); 62 LOGGER.info("启动 Netty 成功");
64 } 63 }
65 - channel = (NioServerSocketChannel) future.channel();  
66 } 64 }
67 65
68 66
@@ -30,8 +30,6 @@ public class NettySocketHolder { @@ -30,8 +30,6 @@ public class NettySocketHolder {
30 } 30 }
31 31
32 public static void remove(NioSocketChannel nioSocketChannel) { 32 public static void remove(NioSocketChannel nioSocketChannel) {
33 - MAP.entrySet().stream().filter(entry -> entry.getValue() == nioSocketChannel).forEach(entry -> {  
34 - MAP.remove(entry.getKey());  
35 - }); 33 + MAP.entrySet().stream().filter(entry -> entry.getValue() == nioSocketChannel).forEach(entry -> MAP.remove(entry.getKey()));
36 } 34 }
37 } 35 }