Преглед изворни кода

perf: skip hasScopeRef check if there are no scope vars

Evan You пре 6 година
родитељ
комит
b980ddb607
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      packages/compiler-core/src/transforms/vSlot.ts

+ 1 - 1
packages/compiler-core/src/transforms/vSlot.ts

@@ -342,7 +342,7 @@ function hasScopeRef(
   node: TemplateChildNode | IfBranchNode | SimpleExpressionNode | undefined,
   ids: TransformContext['identifiers']
 ): boolean {
-  if (!node) {
+  if (!node || Object.keys(ids).length === 0) {
     return false
   }
   switch (node.type) {