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 committed Oct 29, 2017
1 parent 863d192 commit 9d76850
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 9d76850

Please sign in to comment.