Optimitzat el tema de comparacions i asignacions de strings buits. Mes que optimitzat, ara està mes mono

This commit is contained in:
2024-10-13 14:25:05 +02:00
parent ba7c44ad06
commit 46540ad7c3
16 changed files with 47 additions and 53 deletions

View File

@@ -129,7 +129,7 @@ void HiScoreTable::fillTexture()
const auto score = format(options.game.hi_score_table[i].score);
const auto score_lenght = score.size();
const auto num_dots = 25 - name_lenght - score_lenght;
std::string dots = "";
std::string dots;
for (int j = 0; j < (int)num_dots; ++j)
{
dots = dots + ".";
@@ -255,7 +255,7 @@ std::string HiScoreTable::format(int number)
const std::string score = std::to_string(number);
auto index = (int)score.size() - 1;
std::string result = "";
std::string result;
auto i = 0;
while (index >= 0)
{