Skip to main content

Bug Tracker

Side navigation

#1324 closed enhancement (wontfix)

Opened June 26, 2007 01:49PM UTC

Closed May 12, 2008 01:16AM UTC

Last modified May 13, 2008 05:30PM UTC

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 June 26, 2007 01:50PM UTC.

    gain some bytes in filter

Change History (2)

Changed May 12, 2008 01:16AM UTC by flesler comment:1

resolution: → wontfix
status: newclosed

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

Closing.

Changed May 13, 2008 05:30PM UTC by flesler comment:2

milestone: 1.1.31.2.4