Optimized NumberToString algorithm

Fixed useless allocation made by String::Reversed


Former-commit-id: c41c1d5fea3ebb55978fd63284d25c2ad3971ac1
This commit is contained in:
Lynix 2015-02-18 21:03:36 +01:00
parent 2b6dcb4e2b
commit ca88c5bae4
1 changed files with 3 additions and 3 deletions

View File

@ -258,15 +258,15 @@ inline NzString NzNumberToString(long long number, nzUInt8 radix)
do do
{ {
str += symbols[number % radix]; str.Append(symbols[number % radix]);
number /= radix; number /= radix;
} }
while (number > 0); while (number > 0);
if (negative) if (negative)
str += '-'; str.Append('-');
return str.Reversed(); return str.Reverse();
} }
template<typename T> template<typename T>