From ae68f4600b82d6af390b623c76f32d722c3be01a Mon Sep 17 00:00:00 2001 From: Sam Hellawell Date: Tue, 2 Apr 2024 15:18:35 +0100 Subject: [PATCH] Use std::string_view --- components/resource/scenemanager.cpp | 2 +- components/sceneutil/extradata.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index 03b61e7ec3..f67fb21c42 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -663,7 +663,7 @@ namespace Resource node->accept(rigFinder); for (osg::Node* foundRigNode : rigFinder.mFoundNodes) { - if (foundRigNode->libraryName() == std::string("osgAnimation")) + if (foundRigNode->libraryName() == std::string_view("osgAnimation")) { osgAnimation::RigGeometry* foundRigGeometry = static_cast(foundRigNode); diff --git a/components/sceneutil/extradata.cpp b/components/sceneutil/extradata.cpp index 1daa023168..8d024d5824 100644 --- a/components/sceneutil/extradata.cpp +++ b/components/sceneutil/extradata.cpp @@ -47,7 +47,7 @@ namespace SceneUtil { // If an osgAnimation bone/transform, ensure underscores in name are replaced with spaces // this is for compatibility reasons - if (node.libraryName() == std::string("osgAnimation") && node.className() == std::string("Bone")) + if (node.libraryName() == std::string_view("osgAnimation") && node.className() == std::string_view("Bone")) node.setName(Misc::StringUtils::underscoresToSpaces(node.getName())); if (!mSceneMgr->getSoftParticles())