mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 15:50:57 +03:00
enum reverse cache objects
This commit is contained in:
@@ -67,8 +67,7 @@ public enum Message {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
for (Message c : Message.values())
|
for (Message c : Message.values())
|
||||||
if (cache[c.toByte()] == null)
|
cache[c.toByte()] = c;
|
||||||
cache[c.toByte()] = c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Message fromByte(byte b) {
|
public static Message fromByte(byte b) {
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ public enum Signal {
|
|||||||
INT("INT"),
|
INT("INT"),
|
||||||
KILL("KILL"),
|
KILL("KILL"),
|
||||||
PIPE("PIPE"),
|
PIPE("PIPE"),
|
||||||
QUIT(
|
QUIT("QUIT"),
|
||||||
"QUIT"),
|
|
||||||
SEGV("SEGV"),
|
SEGV("SEGV"),
|
||||||
TERM("TERM"),
|
TERM("TERM"),
|
||||||
USR1("USR1"),
|
USR1("USR1"),
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ public enum PacketType {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
for (PacketType t : PacketType.values())
|
for (PacketType t : PacketType.values())
|
||||||
if (cache[t.toByte() & 0xff] == null)
|
cache[t.toByte() & 0xff] = t;
|
||||||
cache[t.toByte() & 0xff] = t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private PacketType(int b) {
|
private PacketType(int b) {
|
||||||
|
|||||||
Reference in New Issue
Block a user