Details
-
Type: Improvement
-
Status: Closed
-
Priority: Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.4.0
-
Fix Version/s: None
-
Component/s: Message Generation
-
Labels:None
-
Environment:All
Description
Hi,
Low priority, but using instanceof instead of msgType.equals(XXX) pattern in MesageCracker.crack
will give a marginal performance boost and improve type safety.
Instead of:
if (msgTypeValue.equals(Heartbeat.MSGTYPE))
{ onMessage((Heartbeat) message, sessionID); } else if (msgTypeValue.equals(Logon.MSGTYPE)) {Use:
if (message instanceof Heartbeat) { onMessage((Heartbeat) message, sessionID); }
else if (message instanceof Logon) {
Also drops requirement to dig into header to get message type.
Hope this helps,
Bill