From a110933cf0223a928a7f047ccb8f0b3ac6562ee5 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 22 Jun 2023 21:22:27 +0000 Subject: [PATCH] Address reviewer feedback Signed-off-by: Michael Carroll --- core/src/DynamicFactory.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/DynamicFactory.cc b/core/src/DynamicFactory.cc index 70f1eadd..f372dc15 100644 --- a/core/src/DynamicFactory.cc +++ b/core/src/DynamicFactory.cc @@ -116,15 +116,13 @@ void DynamicFactory::LoadDescriptors(const std::string &_paths) ////////////////////////////////////////////////// DynamicFactory::MessagePtr DynamicFactory::New(const std::string &_msgType) { - auto msgType = _msgType; - // Shortcut if the type has been already registered. - auto message_it = dynamicMsgMap.find(msgType); - if (message_it != dynamicMsgMap.end()) - return message_it ->second(); + auto messageIt = dynamicMsgMap.find(_msgType); + if (messageIt != dynamicMsgMap.end()) + return messageIt ->second(); // Nothing to do if we don't know about this type in the descriptor map. - auto descriptor = pool.FindMessageTypeByName(msgType); + auto descriptor = pool.FindMessageTypeByName(_msgType); if (!descriptor) return nullptr;