mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 12:20:07 +00:00
Improve implementation of function VmaStringBuilder::AddNumber
This commit is contained in:
parent
470399abf0
commit
6ac1d3a4b7
@ -7054,15 +7054,29 @@ void VmaStringBuilder::Add(const char* pStr)
|
|||||||
void VmaStringBuilder::AddNumber(uint32_t num)
|
void VmaStringBuilder::AddNumber(uint32_t num)
|
||||||
{
|
{
|
||||||
char buf[11];
|
char buf[11];
|
||||||
VmaUint32ToStr(buf, sizeof(buf), num);
|
buf[10] = '\0';
|
||||||
Add(buf);
|
char *p = &buf[10];
|
||||||
|
do
|
||||||
|
{
|
||||||
|
*--p = '0' + (num % 10);
|
||||||
|
num /= 10;
|
||||||
|
}
|
||||||
|
while(num);
|
||||||
|
Add(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VmaStringBuilder::AddNumber(uint64_t num)
|
void VmaStringBuilder::AddNumber(uint64_t num)
|
||||||
{
|
{
|
||||||
char buf[21];
|
char buf[21];
|
||||||
VmaUint64ToStr(buf, sizeof(buf), num);
|
buf[20] = '\0';
|
||||||
Add(buf);
|
char *p = &buf[20];
|
||||||
|
do
|
||||||
|
{
|
||||||
|
*--p = '0' + (num % 10);
|
||||||
|
num /= 10;
|
||||||
|
}
|
||||||
|
while(num);
|
||||||
|
Add(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VmaStringBuilder::AddPointer(const void* ptr)
|
void VmaStringBuilder::AddPointer(const void* ptr)
|
||||||
|
Loading…
Reference in New Issue
Block a user