diff options
author | Tobias Nießen <tniessen@tnie.de> | 2017-10-15 14:32:58 +0200 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2017-10-29 19:40:40 +0100 |
commit | 9d768504d25a2b2899a8d1826794ca24be7e65df (patch) | |
tree | 499d924ca2102f0ca1a837d5fe627347790bc52b /tools | |
parent | 863d1922df7cff317942eba6ba0257cde6d69c0d (diff) | |
download | android-node-v8-9d768504d25a2b2899a8d1826794ca24be7e65df.tar.gz android-node-v8-9d768504d25a2b2899a8d1826794ca24be7e65df.tar.bz2 android-node-v8-9d768504d25a2b2899a8d1826794ca24be7e65df.zip |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/license2rtf.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/license2rtf.js b/tools/license2rtf.js index a32a121135..4c8f6827df 100644 --- a/tools/license2rtf.js +++ b/tools/license2rtf.js @@ -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) { |