Opened 12 years ago
Closed 11 years ago
#5476 closed enhancement (fixed)
Prevent get(-1) to create a new jQuery object
| Reported by: | Robert Katić | Owned by: | jitter |
|---|---|---|---|
| Priority: | high | Milestone: | 1.5 |
| Component: | core | Version: | 1.4.4 |
| Keywords: | get, slice | Cc: | |
| Blocked by: | Blocking: |
Description
Instead of
( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
you will write
( num < 0 ? slice.call(this, num)[ 0 ] : this[ num ] );
or even better (for me)
( num < 0 ? this[ this.length - num ] : this[ num ] );
Change History (7)
comment:1 Changed 12 years ago by
comment:2 Changed 11 years ago by
| Owner: | set to Robert Katić |
|---|---|
| Status: | new → pending |
Sorry, what is the issue here? What use case is there for this?
comment:3 Changed 11 years ago by
| Status: | pending → new |
|---|
.get(Number) returns a single element. It is unnecessary and relatively expensive to create a new jQuery object calling .slice() only to get a single value.
comment:4 Changed 11 years ago by
| Milestone: | → 1.5 |
|---|---|
| Priority: | major → high |
| Status: | new → open |
| Version: | 1.3.2 → 1.4.4 |
comment:5 Changed 11 years ago by
| Owner: | changed from Robert Katić to jitter |
|---|---|
| Status: | open → assigned |
comment:6 Changed 11 years ago by
| Milestone: | 1.5 → 1.4.5 |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Landed.
comment:7 Changed 10 years ago by
| Milestone: | 1.4.5 → 1.5 |
|---|
Move fixed tickets to appropriate milestone
Note: See
TracTickets for help on using
tickets.

oops, wrong sign