From 895864099cee6c3175fa7edd6c10460da332636d Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 23 Jun 2021 23:29:14 +0200 Subject: [PATCH] Simplify NodeMapVisitor::apply No need to run a find() before a std::replace --- components/sceneutil/visitor.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/components/sceneutil/visitor.cpp b/components/sceneutil/visitor.cpp index 60f99b2fef..1f5a0ea4cf 100644 --- a/components/sceneutil/visitor.cpp +++ b/components/sceneutil/visitor.cpp @@ -65,11 +65,7 @@ namespace SceneUtil if (trans.libraryName() == std::string("osgAnimation")) { // Convert underscores to whitespaces as a workaround for Collada (OpenMW's animation system uses whitespace-separated names) - std::string underscore = "_"; - std::size_t foundUnderscore = originalNodeName.find(underscore); - - if (foundUnderscore != std::string::npos) - std::replace(originalNodeName.begin(), originalNodeName.end(), '_', ' '); + std::replace(originalNodeName.begin(), originalNodeName.end(), '_', ' '); } const std::string nodeName = originalNodeName;