- Notifications
You must be signed in to change notification settings - Fork20.6k
Manipulation:Selector: Use the nodeName util where possible to save size#4504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@@ -603,13 +604,13 @@ Expr = jQuery.expr = { | |||
}, | |||
TAG: function( nodeNameSelector ) { | |||
varnodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); | |||
varexpectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I thought it might save a bit more to name thisnodeNameExpected
but it was the same. One day I will understand gzip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@dmethvin Minification happens before gzip so source variable names are irrelevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ALL THE BYTES
Uh oh!
There was an error while loading.Please reload this page.
Summary
Use the
nodeName
util where possible to save size.-20 bytes
Checklist
New tests have been added to show the fix or feature worksIf needed, a docs issue/PR was created athttps://github.com/jquery/api.jquery.com