Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14630 closed feature (notabug)

replace this with a local variable to save minified file size

Reported by: anonymous Owned by: anonymous
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

it will be save about 1k if replace this with a local variable. e.g.

get: function( num ) {
		return num != null ?

			// Return a 'clean' array
			( num < 0 ? this[ num + this.length ] : this[ num ] ) :

			// Return just the object
			slice.call( this );
	}

replace it with

get: function( num ) {
   var that = this;
		return num != null ?

			// Return a 'clean' array
			( num < 0 ? that[ num + that.length ] : that[ num ] ) :

			// Return just the object
			slice.call( that );
	}

Change History (3)

comment:1 Changed 9 years ago by scottgonzalez

Owner: set to anonymous
Status: newpending

Did you do your test using gzip? Because I've found that this actually hurts the file size.

Last edited 9 years ago by scottgonzalez (previous) (diff)

comment:2 Changed 9 years ago by anonymous

Status: pendingnew

oops, this is a whim recommendation. close this ticket please.

comment:3 Changed 9 years ago by scottgonzalez

Resolution: notabug
Status: newclosed
Note: See TracTickets for help on using tickets.