tweak StringOutputStream use

auto str = StringOutputStream()(bla) use form was not doing copy elision or move, but copy
This commit is contained in:
Garux
2024-01-29 16:54:08 +06:00
parent b4e44bc8ed
commit df02774ff5
122 changed files with 984 additions and 1204 deletions

View File

@@ -82,9 +82,7 @@ void process_xlink( const char* filename, const char *menu_name, const char *bas
else
{
// relative URL
StringOutputStream full( 256 );
full << base_url << reinterpret_cast<const char*>( prop );
url = full.c_str();
url = StringStream( base_url, reinterpret_cast<const char*>( prop ) );
}
mHelpURLs.push_back( url );
@@ -113,18 +111,16 @@ void process_xlink( const char* filename, const char *menu_name, const char *bas
}
void create_game_help_menu( QMenu *menu ){
auto filename = StringOutputStream( 256 )( AppPath_get(), "global.xlink" );
process_xlink( filename.c_str(), "General", AppPath_get(), menu );
auto filename = StringStream<256>( AppPath_get(), "global.xlink" );
process_xlink( filename, "General", AppPath_get(), menu );
#if 1
filename( g_pGameDescription->mGameToolsPath, "game.xlink" );
process_xlink( filename.c_str(), g_pGameDescription->getRequiredKeyValue( "name" ), g_pGameDescription->mGameToolsPath.c_str(), menu );
process_xlink( filename, g_pGameDescription->getRequiredKeyValue( "name" ), g_pGameDescription->mGameToolsPath.c_str(), menu );
#else
for ( std::list<CGameDescription *>::iterator iGame = g_GamesDialog.mGames.begin(); iGame != g_GamesDialog.mGames.end(); ++iGame )
{
filename.clear();
filename << ( *iGame )->mGameToolsPath.c_str() << "game.xlink";
process_xlink( filename.c_str(), ( *iGame )->getRequiredKeyValue( "name" ), ( *iGame )->mGameToolsPath.c_str(), menu );
filename( ( *iGame )->mGameToolsPath.c_str(), "game.xlink" );
process_xlink( filename, ( *iGame )->getRequiredKeyValue( "name" ), ( *iGame )->mGameToolsPath.c_str(), menu );
}
#endif
}