From: JP Dinger Date: Fri, 20 Nov 2009 15:00:22 +0000 (+0100) Subject: Skins2: Drop another small heap allocation in favour of the stack. X-Git-Tag: 1.1.0-ff~2202 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=dc4b469e50c585d94d7ca7f59918546f29b36cd5;p=vlc Skins2: Drop another small heap allocation in favour of the stack. --- diff --git a/modules/gui/skins2/vars/volume.cpp b/modules/gui/skins2/vars/volume.cpp index a965dbd4a4..075057df17 100644 --- a/modules/gui/skins2/vars/volume.cpp +++ b/modules/gui/skins2/vars/volume.cpp @@ -60,11 +60,8 @@ string Volume::getAsStringPercent() const { int value = (int)(100. * VarPercent::get()); // 0 <= value <= 100, so we need 4 chars - char *str = new char[4]; + char str[4]; snprintf( str, 4, "%d", value ); - string ret = str; - delete[] str; - - return ret; + return string(str); }