faster zeropad2(); #1281
Costa Tsaousis (ktsaou) committed
Nov 26, 2016 at 15:32 UTC
6677e3fe89ad5afd8bfafb5128c57d07187732df
1 file changed
+1
-8
node.d/node_modules/netdata.js
+1
-8
@@ -134,14 +134,7 @@ var netdata = {
134
},
135
136
zeropad2: function(s) {
137
- if(typeof s !== 'string')
138
- s = s.toString();
139
-
140
- switch(s.length) {
141
- case 0: return '00';
142
- case 1: return '0' + s;
143
- default: return s;
144
- }
137
+ return ("00" + s).slice(-2);
138
},
139
140
logdate: function(d) {