From 79afe82774c25f1cce9fd390dc64dfc6141c424f Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Wed, 8 Nov 2017 15:57:34 +0100 Subject: [PATCH] replace string with stringstream (avoid a string copy at read) --- src/osgPlugins/gz/ReaderWriterGZ.cpp | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/osgPlugins/gz/ReaderWriterGZ.cpp b/src/osgPlugins/gz/ReaderWriterGZ.cpp index 477390407..5e8a5bdf3 100644 --- a/src/osgPlugins/gz/ReaderWriterGZ.cpp +++ b/src/osgPlugins/gz/ReaderWriterGZ.cpp @@ -81,11 +81,11 @@ class ReaderWriterGZ : public osgDB::ReaderWriter osgDB::ReaderWriter *getStreamAndReader(std::stringstream& outuncompessed, std::istream& fin, const std::string& fullFileName) const { std::string ext = osgDB::getLowerCaseFileExtension(fullFileName); osgDB::ReaderWriter* rw = 0; - rw = osgDB::Registry::instance()->getReaderWriterForExtension(ext); - std::string baseFileName = osgDB::getNameLessExtension(fullFileName); - std::string baseExt = osgDB::getLowerCaseFileExtension(baseFileName); - rw = osgDB::Registry::instance()->getReaderWriterForExtension(baseExt); - OSG_INFO<getReaderWriterForExtension( ext ); + std::string baseFileName = osgDB::getNameLessExtension( fullFileName ); + std::string baseExt = osgDB::getLowerCaseFileExtension( baseFileName ); + rw = osgDB::Registry::instance()->getReaderWriterForExtension( baseExt ); + OSG_INFO<< className() << "::getStreamAndReader:" << baseExt << " ReaderWriter " << rw <