Commit dc4b469e authored by JP Dinger's avatar JP Dinger
Browse files

Skins2: Drop another small heap allocation in favour of the stack.

parent abaee12a
...@@ -60,11 +60,8 @@ string Volume::getAsStringPercent() const ...@@ -60,11 +60,8 @@ string Volume::getAsStringPercent() const
{ {
int value = (int)(100. * VarPercent::get()); int value = (int)(100. * VarPercent::get());
// 0 <= value <= 100, so we need 4 chars // 0 <= value <= 100, so we need 4 chars
char *str = new char[4]; char str[4];
snprintf( str, 4, "%d", value ); snprintf( str, 4, "%d", value );
string ret = str; return string(str);
delete[] str;
return ret;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment