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 31, 2017
1 parent b93275e commit d5891b5
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 d5891b5

Please sign in to comment.