优化代码,性能暴涨

This commit is contained in:
Administrator
2025-01-29 14:01:11 +08:00
parent e243203535
commit 6de65562be
130 changed files with 9138 additions and 1020 deletions
+40
View File
@@ -0,0 +1,40 @@
package org.kne.cloud.network;
import java.util.Objects;
public class PortPair {
private int sport;
private int dport;
@Override
public String toString() {
return sport+"->"+dport;
}
public PortPair(int sport, int dport) {
super();
this.sport = sport;
this.dport = dport;
}
public int getSport() {
return sport;
}
public int getDport() {
return dport;
}
@Override
public int hashCode() {
return Objects.hash(dport, sport);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PortPair other = (PortPair) obj;
return dport == other.dport && sport == other.sport;
}
}