Skip to content

Commit

Permalink
Address reviewer feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Jun 23, 2023
1 parent 5fc7a7e commit a110933
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/src/DynamicFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a110933

Please sign in to comment.