Ticket #1324 (closed enhancement: wontfix)
save some byte in filter
| Reported by: | rformato | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.4 |
| Component: | core | Version: | 1.1.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi, I continue my search to save bytes in jQuery.
My current target is the filter function which refers multiple times to jQuery.expr[ m[1] ]
I stored this value in a var saving 17 bytes.
In the code there is also a resort call that moves the elements inside m to different indexes. However, it seems that the m[1] element remains at index 1.
This, even if dangerous in the long run (more resort functions can appear in the future moving the m[1] element), could bring us even more compression (saving 30 bytes).
This last optimization consists in deleting the second f assignment
f = jQuery.expr[ m[1] ]; if ( f._resort ) m = f._resort( m ); f = jQuery.expr[ m[1] ];
The "secure" patch is attached.
Attachments
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


gain some bytes in filter