Skip to content

Commit d9a51af

Browse files
golopotljharb
authored andcommitted
[Perf] isCreateElement: improve performance for rules using isCreateElement
1 parent 5baa3e0 commit d9a51af

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/util/isCreateElement.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ const isDestructuredFromPragmaImport = require('./isDestructuredFromPragmaImport
1010
* @returns {Boolean} - True if node is a createElement call object literal, False if not.
1111
*/
1212
module.exports = function isCreateElement(node, context) {
13-
const pragma = pragmaUtil.getFromContext(context);
1413
if (
1514
node.callee
1615
&& node.callee.type === 'MemberExpression'
1716
&& node.callee.property.name === 'createElement'
1817
&& node.callee.object
19-
&& node.callee.object.name === pragma
18+
&& node.callee.object.name === pragmaUtil.getFromContext(context)
2019
) {
2120
return true;
2221
}

0 commit comments

Comments
 (0)