philadelphia-core: Extract MsgSeqNum(34) handling
Only handle the common case on the fast path.
@@ -524,13 +524,8 @@ public class FIXConnection implements Closeable {
return;
}
- if (msgSeqNum > rxMsgSeqNum) {
- sendResendRequest(rxMsgSeqNum);
- return;
- }
-
- if (msgSeqNum < rxMsgSeqNum) {
- handleTooLowMsgSeqNum(message, msgType, msgSeqNum);
+ if (msgSeqNum != rxMsgSeqNum) {
+ handleMsgSeqNum(message, msgType, msgSeqNum);
return;
}
@@ -568,6 +563,13 @@ public class FIXConnection implements Closeable {
}
}
+ private void handleMsgSeqNum(FIXMessage message, FIXValue msgType, long msgSeqNum) throws IOException {
+ if (msgSeqNum < rxMsgSeqNum)
+ handleTooLowMsgSeqNum(message, msgType, msgSeqNum);
+ else
+ sendResendRequest(rxMsgSeqNum);
+ }
+
private void handleTooLowMsgSeqNum(FIXMessage message, FIXValue msgType, long msgSeqNum) throws IOException {
if (msgType.length() != 1 || msgType.asChar() != SequenceReset) {
FIXValue possDupFlag = message.valueOf(PossDupFlag);
