From adc5015ad986a2f7bb2f9f4283a40fac86de762b Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Sun, 13 Sep 2009 19:29:29 +0000 Subject: [PATCH] small optimization in Parser::Parse(const wchar_t *) git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@194 e52654a7-88a9-db11-a3e9-0013d4bc506e --- ttmath/ttmathparser.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ttmath/ttmathparser.h b/ttmath/ttmathparser.h index 547d031..664ab85 100644 --- a/ttmath/ttmathparser.h +++ b/ttmath/ttmathparser.h @@ -432,6 +432,12 @@ VariablesTable variables_table; CGamma cgamma; +/*! + temporary object for a whole string when Parse(std::wstring) is used +*/ +std::string wide_to_ansi; + + /*! we're using this method for reporting an error */ @@ -2591,10 +2597,9 @@ ErrorCode Parse(const std::string & str) */ ErrorCode Parse(const wchar_t * str) { - std::string temp; - Misc::AssignString(temp, str); + Misc::AssignString(wide_to_ansi, str); -return Parse(temp.c_str()); +return Parse(wide_to_ansi.c_str()); }