Bug Tracker

Modify

Ticket #1324 (closed enhancement: wontfix)

Opened 6 years ago

Last modified 5 years ago

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

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

Change History

Changed 6 years ago by rformato

gain some bytes in filter

comment:1 Changed 5 years ago by flesler

  • Status changed from new to closed
  • Resolution set to wontfix

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

Closing.

comment:2 Changed 5 years ago by flesler

  • Milestone changed from 1.1.3 to 1.2.4

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.