mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
build_stage_source - use std::string reserve and append, significantly
faster
This commit is contained in:
parent
0b52823f2c
commit
0aa266a6ca
@ -47,10 +47,11 @@ static std::string build_stage_source(
|
||||
|
||||
if (lines->size < 1)
|
||||
return "";
|
||||
str.reserve(lines->size);
|
||||
|
||||
/* Version header. */
|
||||
str += lines->elems[0].data;
|
||||
str += '\n';
|
||||
str.append(lines->elems[0].data);
|
||||
str.append("\n");
|
||||
|
||||
for (i = 1; i < lines->size; i++)
|
||||
{
|
||||
@ -82,12 +83,12 @@ static std::string build_stage_source(
|
||||
/* Ignore */
|
||||
}
|
||||
else if (active)
|
||||
str += line;
|
||||
str.append(line);
|
||||
}
|
||||
else if (active)
|
||||
str += line;
|
||||
str.append(line);
|
||||
|
||||
str += '\n';
|
||||
str.append("\n");
|
||||
}
|
||||
|
||||
return str;
|
||||
|
Loading…
x
Reference in New Issue
Block a user