tools: replace loop with padStart

PR-URL: https://github.com/nodejs/node/pull/16220
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Tobias Nießen 2017-10-15 14:32:58 +02:00
parent 863d1922df
commit 9d768504d2
No known key found for this signature in database
GPG Key ID: 718207F8FD156B70

View File

@ -274,10 +274,7 @@ function RtfGenerator() {
};
function toHex(number, length) {
var hex = (~~number).toString(16);
while (hex.length < length)
hex = `0${hex}`;
return hex;
return (~~number).toString(16).padStart(length, '0');
}
function rtfEscape(string) {