1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

IntTable10 is not needed.

This commit is contained in:
Bartosz Taudul 2019-02-10 00:51:13 +01:00
parent d940e315bd
commit ee66b1354d

View File

@ -54,28 +54,26 @@ static const char* IntTable100 =
"80818283848586878889" "80818283848586878889"
"90919293949596979899"; "90919293949596979899";
static const char* IntTable10 = "0123456789";
static inline void PrintTinyInt( char*& buf, uint64_t v ) static inline void PrintTinyInt( char*& buf, uint64_t v )
{ {
if( v >= 10 ) if( v >= 10 )
{ {
*buf++ = IntTable10[v/10]; *buf++ = '0' + v/10;
} }
*buf++ = IntTable10[v%10]; *buf++ = '0' + v%10;
} }
static inline void PrintTinyInt0( char*& buf, uint64_t v ) static inline void PrintTinyInt0( char*& buf, uint64_t v )
{ {
if( v >= 10 ) if( v >= 10 )
{ {
*buf++ = IntTable10[v/10]; *buf++ = '0' + v/10;
} }
else else
{ {
*buf++ = '0'; *buf++ = '0';
} }
*buf++ = IntTable10[v%10]; *buf++ = '0' + v%10;
} }
static inline void PrintSmallInt( char*& buf, uint64_t v ) static inline void PrintSmallInt( char*& buf, uint64_t v )
@ -87,9 +85,9 @@ static inline void PrintSmallInt( char*& buf, uint64_t v )
} }
else if( v >= 10 ) else if( v >= 10 )
{ {
*buf++ = IntTable10[v/10]; *buf++ = '0' + v/10;
} }
*buf++ = IntTable10[v%10]; *buf++ = '0' + v%10;
} }
static inline void PrintFrac00( char*& buf, uint64_t v ) static inline void PrintFrac00( char*& buf, uint64_t v )
@ -102,7 +100,7 @@ static inline void PrintFrac00( char*& buf, uint64_t v )
static inline void PrintFrac0( char*& buf, uint64_t v ) static inline void PrintFrac0( char*& buf, uint64_t v )
{ {
*buf++ = '.'; *buf++ = '.';
*buf++ = IntTable10[(v+50)/100]; *buf++ = '0' + (v+50)/100;
} }
static inline void PrintSmallIntFrac( char*& buf, uint64_t v ) static inline void PrintSmallIntFrac( char*& buf, uint64_t v )