Skip to content

Commit e402694

Browse files
tniessengibfahn
authored andcommitted
tools: replace loop with padStart
PR-URL: #16220 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent bb475ab commit e402694

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tools/license2rtf.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,7 @@ function RtfGenerator() {
274274
};
275275

276276
function toHex(number, length) {
277-
var hex = (~~number).toString(16);
278-
while (hex.length < length)
279-
hex = `0${hex}`;
280-
return hex;
277+
return (~~number).toString(16).padStart(length, '0');
281278
}
282279

283280
function rtfEscape(string) {

0 commit comments

Comments
 (0)