From b5483d40502ead7e969a3c8b900bb85e2db6dc39 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 10 Oct 2013 20:36:25 +0200 Subject: [PATCH] CNeutrinoFonts: performance fix Variable '_height' is reassigned a value before the old one has been used. --- src/driver/neutrinofonts.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 2a3808c4c..1e42bd049 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -230,13 +230,13 @@ int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) if (dx == 0) dx = 1280; while (1) { - if (dynFont != NULL) + if (dynFont) delete dynFont; dynFont = g_dynFontRenderer->getFont(fontDescr.name.c_str(), dynFontStyle[style].c_str(), dynSize); - int _width = 0; - int _height = 0; // calculate height & width - _height = getFontHeight(dynFont); + int _width = 0; + int _height = getFontHeight(dynFont);; + std::string tmpText = text; if (text == "") tmpText = "x"; _width = dynFont->getRenderWidth(tmpText.c_str()); @@ -255,7 +255,7 @@ int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) break; } - if (dynFont != NULL) + if (dynFont) delete dynFont; return dynSize;