Fix an inefficiency in listing. Using std::string here allocates memory needlessly.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12810 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
curaga
2013-05-30 12:37:59 +00:00
parent 7986aa66de
commit b8cc3217d2

View File

@@ -894,15 +894,15 @@ int handleCmdLine(int argc, char **argv)
for (size_t i = 0; i != track_manager->getNumberOfTracks(); i++)
{
const Track *track = track_manager->getTrack(i);
std::string locked="";
const char * locked = "";
if ( unlock_manager->getCurrentSlot()
->isLocked(track->getIdent()) )
{
locked=" (locked)";
locked = " (locked)";
}
Log::info("main", "%-18s: %ls %s",
track->getIdent().c_str(),
track->getName(), locked.c_str());
track->getName(), locked);
//}
}
@@ -920,12 +920,12 @@ int handleCmdLine(int argc, char **argv)
kart_properties_manager->getKartById(i);
unlock_manager->setCurrentSlot(UserConfigParams::m_all_players[0]
.getUniqueID() );
std::string locked = "";
const char * locked = "";
if (unlock_manager->getCurrentSlot()->isLocked(KP->getIdent()))
locked="(locked)";
locked = "(locked)";
Log::info("main", " %-10s: %ls %s", KP->getIdent().c_str(),
KP->getName(), locked.c_str());
KP->getName(), locked);
}
exit(0);