Minute performance improvement for Sign.getText

This commit is contained in:
Simon Robertshaw
2013-10-19 17:22:43 +01:00
parent eea006ad6f
commit cebd28148d

View File

@@ -17,6 +17,8 @@ std::string sign::getText(Simulation *sim)
char signText[256];
sprintf(signText, "%s", text.substr(0, 255).c_str());
if(signText[0] && signText[0] == '{')
{
if (!strcmp(signText,"{p}"))
{
float pressure = 0.0f;
@@ -42,6 +44,11 @@ std::string sign::getText(Simulation *sim)
else
strcpy(buff, signText);
}
}
else
{
strcpy(buff, signText);
}
return std::string(buff);
}