Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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:
Blocked by: Blocking:

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 (1)

filter.patch (1.1 KB) - added by rformato 12 years ago.
gain some bytes in filter

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by rformato

Attachment: filter.patch added

gain some bytes in filter

comment:1 Changed 12 years ago by flesler

Resolution: wontfix
Status: newclosed

This is old, there's nothing like this now.

Closing.

comment:2 Changed 12 years ago by flesler

Milestone: 1.1.31.2.4
Note: See TracTickets for help on using tickets.