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 b0c0352

Browse filesBrowse files
vsemozhetbytMylesBorins
authored andcommitted
tools: dedupe property access in doc/type-parser
There is no need to get this property twice in this rather hot spot: if there is no such key, the `typeUrl` will be `undefined`, which suffices for the boolean check in the next line. For consistency, `undefined` can also be made the default value. PR-URL: #20387 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent fcc5492 commit b0c0352
Copy full SHA for b0c0352

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎tools/doc/type-parser.js‎

Copy file name to clipboardExpand all lines: tools/doc/type-parser.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function toLink(typeInput) {
130130
typeTexts.forEach((typeText) => {
131131
typeText = typeText.trim();
132132
if (typeText) {
133-
let typeUrl = null;
133+
let typeUrl;
134134

135135
// To support type[], type[][] etc., we store the full string
136136
// and use the bracket-less version to lookup the type URL.
@@ -143,7 +143,7 @@ function toLink(typeInput) {
143143
typeUrl = `${jsDataStructuresUrl}#${primitive}_type`;
144144
} else if (jsGlobalTypes.includes(typeText)) {
145145
typeUrl = `${jsGlobalObjectsUrl}${typeText}`;
146-
} else if (customTypesMap[typeText]) {
146+
} else {
147147
typeUrl = customTypesMap[typeText];
148148
}
149149

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.