Skip to content

Commit

Permalink
tools: replace loop with padStart
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tniessen authored and gibfahn committed Oct 30, 2017
1 parent 139552e commit 8c1332c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tools/license2rtf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8c1332c

Please sign in to comment.