From c8af752ce82446285db90c5b26c32ea26348a552 Mon Sep 17 00:00:00 2001 From: Chiawen Chen Date: Thu, 6 Oct 2022 17:20:32 +0800 Subject: [PATCH] [Perf] improve performance by optimizing getId --- lib/util/Components.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/Components.js b/lib/util/Components.js index 7b931c2234..b112923f63 100644 --- a/lib/util/Components.js +++ b/lib/util/Components.js @@ -21,7 +21,7 @@ const isFirstLetterCapitalized = require('./isFirstLetterCapitalized'); const isDestructuredFromPragmaImport = require('./isDestructuredFromPragmaImport'); function getId(node) { - return node && node.range.join(':'); + return node ? `${node.range[0]}:${node.range[1]}` : ''; } function usedPropTypesAreEquivalent(propA, propB) {