Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d5891b5

Browse filesBrowse 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 b93275e commit d5891b5
Copy full SHA for d5891b5

File tree

Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed
Open diff view settings
Collapse file

‎tools/license2rtf.js‎

Copy file name to clipboardExpand all lines: tools/license2rtf.js
+1-4Lines changed: 1 addition & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.