diff --git a/QuickFIXn/MessageCracker.cs b/QuickFIXn/MessageCracker.cs index 989a969ae..98126dc22 100644 --- a/QuickFIXn/MessageCracker.cs +++ b/QuickFIXn/MessageCracker.cs @@ -53,12 +53,13 @@ private void TryBuildCallCache(MethodInfo m) public static bool IsHandlerMethod(MethodInfo m) { + ParameterInfo[] parameters; return m.IsPublic + && m.ReturnType == typeof(void) && m.Name.Equals("OnMessage") - && m.GetParameters().Length == 2 - && m.GetParameters()[0].ParameterType.IsSubclassOf(typeof(Message)) - && typeof(SessionID).IsAssignableFrom(m.GetParameters()[1].ParameterType) - && m.ReturnType == typeof(void); + && (parameters = m.GetParameters()).Length == 2 + && parameters[0].ParameterType.IsSubclassOf(typeof(Message)) + && typeof(SessionID).IsAssignableFrom(parameters[1].ParameterType); } diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7a188562c..364322262 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -49,6 +49,7 @@ What's New * #910 - faster Message.GetMsgType that doesn't use Regex (jkulubya) * #516 - remove ability to toggle Session-enable via HttpServer because it never really worked (gbirchmeier) * #913/#741 - new FieldMap.ReadGroups for iterating on groups (NoviProg/gbirchmeier) +* #914 - Optimize MessageCracker.IsHandlerMethod (vasily-balansea) ### v1.12.0