Skip to content

Commit 0af35ed

Browse files
committed
minor change
1 parent c96a276 commit 0af35ed

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/bt_factory.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,25 +263,23 @@ std::unique_ptr<TreeNode> BehaviorTreeFactory::instantiateTreeNode(
263263
substituted = true;
264264
break;
265265
}
266-
// NOLINTNEXTLINE(readability-else-after-return)
267-
else if(const auto* const test_config = std::get_if<TestNodeConfig>(&rule))
266+
267+
if(const auto* const test_config = std::get_if<TestNodeConfig>(&rule))
268268
{
269269
node = std::make_unique<TestNode>(name, config,
270270
std::make_shared<TestNodeConfig>(*test_config));
271271
substituted = true;
272272
break;
273273
}
274-
else if(const auto* const test_config =
275-
std::get_if<std::shared_ptr<TestNodeConfig>>(&rule))
274+
275+
if(const auto* const test_config =
276+
std::get_if<std::shared_ptr<TestNodeConfig>>(&rule))
276277
{
277278
node = std::make_unique<TestNode>(name, config, *test_config);
278279
substituted = true;
279280
break;
280281
}
281-
else
282-
{
283-
throw LogicError("Substitution rule is not a string or a TestNodeConfig");
284-
}
282+
throw LogicError("Substitution rule is not a string or a TestNodeConfig");
285283
}
286284
}
287285

0 commit comments

Comments
 (0)