From c471f7e18f2b6b14c660d0307a9a32f1194b2e2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 22 Aug 2007 06:17:24 +0000 Subject: [PATCH] slight optimization for wxHtmlEntitiesParser::GetEntityChar() in UTF-8 build: use wx_str() instead of c_str() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/htmlpars.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 4d7342ec30..1ea5e979ed 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -558,16 +558,18 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const if (entity[0] == wxT('#')) { - const wxChar *ent_s = entity.c_str(); - const wxChar *format; + // NB: parsed value is a number, so it's OK to use wx_str(), internal + // representation is the same for numbers + const wxStringCharType *ent_s = entity.wx_str(); + const wxStringCharType *format; - if (ent_s[1] == wxT('x') || ent_s[1] == wxT('X')) + if (ent_s[1] == wxSTRING_TEXT('x') || ent_s[1] == wxSTRING_TEXT('X')) { - format = wxT("%x"); + format = wxSTRING_TEXT("%x"); ent_s++; } else - format = wxT("%u"); + format = wxSTRING_TEXT("%u"); ent_s++; if (wxSscanf(ent_s, format, &code) != 1) -- 2.45.2