Miscellaneous perf tweak (#10421)
* refactor: early return on hot path * refactor: read next2 only when next is dot * perf: mini refactor
This commit is contained in:
committed by
Nicolò Ribaudo
parent
610d6bdc62
commit
4395c22f3a
@@ -39,10 +39,11 @@ export default class CommentsParser extends BaseParser {
|
||||
}
|
||||
|
||||
adjustCommentsAfterTrailingComma(node: Node, elements: Node[]) {
|
||||
if (elements.length === 0) {
|
||||
if (this.state.leadingComments.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (this.state.leadingComments.length === 0) {
|
||||
|
||||
if (elements.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user