summaryrefslogtreecommitdiff
path: root/itoa_ljust.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2016-12-30 19:36:16 -0800
committerdormando <dormando@rydia.net>2017-01-07 18:22:56 -0800
commitc2027ad42a727e26116e06592a3b4965731d30e7 (patch)
tree082feab871f9bbeb481d31a6ea03954444d6e98e /itoa_ljust.c
parent1cc77e6824c3dc9dc5f1ba679df9a49fc3cbeff3 (diff)
downloadmemcached-c2027ad42a727e26116e06592a3b4965731d30e7.tar.gz
conditionally don't inline the ASCII VALUE line
missing methods of changing the value. uses what should be a high speed itoa instead of snprintf in a handful of places. Should speed up sets, reduce memory overhead, and ideally not slow down gets too much.
Diffstat (limited to 'itoa_ljust.c')
-rw-r--r--itoa_ljust.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/itoa_ljust.c b/itoa_ljust.c
index 4ed9267..7921f7f 100644
--- a/itoa_ljust.c
+++ b/itoa_ljust.c
@@ -107,7 +107,7 @@ static inline char* itoa(uint32_t u, char* p, int d, int n) {
}
char* itoa_u32(uint32_t u, char* p) {
- int d,n;
+ int d = 0,n;
if (u >=100000000) n = digits(u, 100000000, &d, &p, 10);
else if (u < 100) n = digits(u, 1, &d, &p, 2);
else if (u < 10000) n = digits(u, 100, &d, &p, 4);