Skip to content
This repository has been archived by the owner on Aug 31, 2018. It is now read-only.

Commit

Permalink
tools: replace loop with padStart
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node#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 Qard committed Nov 2, 2017
1 parent 6b2b45f commit 5bc6daf
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 5bc6daf

Please sign in to comment.