1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Merge branch 'coverity_strings' into 'master'

Simplify strings construction

See merge request OpenMW/openmw!3310
This commit is contained in:
psi29a 2023-08-03 07:15:06 +00:00
commit 4557d20f0b
2 changed files with 3 additions and 8 deletions

View File

@ -434,15 +434,12 @@ void MwIniImporter::insertMultistrmap(multistrmap& cfg, const std::string& key,
void MwIniImporter::importArchives(multistrmap& cfg, const multistrmap& ini) const
{
std::vector<std::string> archives;
std::string baseArchive("Archives:Archive ");
std::string archive;
// Search archives listed in ini file
auto it = ini.begin();
for (int i = 0; it != ini.end(); i++)
{
archive = baseArchive;
archive.append(std::to_string(i));
std::string archive("Archives:Archive " + std::to_string(i));
it = ini.find(archive);
if (it == ini.end())
@ -537,8 +534,7 @@ void MwIniImporter::importGameFiles(
auto it = ini.begin();
for (int i = 0; it != ini.end(); i++)
{
std::string gameFile("Game Files:GameFile");
gameFile.append(std::to_string(i));
std::string gameFile("Game Files:GameFile" + std::to_string(i));
it = ini.find(gameFile);
if (it == ini.end())

View File

@ -398,7 +398,6 @@ namespace Gui
file->read(name_, sizeof(name_));
if (!file->good())
fail(*file, fileName, "File too small to be a valid font");
std::string name(name_);
GlyphInfo data[256];
file->read((char*)data, sizeof(data));
@ -408,7 +407,7 @@ namespace Gui
file.reset();
// Create the font texture
std::string bitmapFilename = "fonts/" + std::move(name) + ".tex";
std::string bitmapFilename = "fonts/" + std::string(name_) + ".tex";
Files::IStreamPtr bitmapFile = mVFS->get(bitmapFilename);