#11720 closed enhancement (fixed)
Simplify jQuery.nth
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | traversing | Version: | git |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Since jQuery.nth is not a documented function and only used internally, its code could be simplified. It is only called at two places:
next: function( elem ) { return jQuery.nth( elem, 2, "nextSibling" ); }, prev: function( elem ) { return jQuery.nth( elem, 2, "previousSibling" ); },
The second argument could be removed and inlined, so that jQuery.nth can be simplified a fair bit.
Change History (4)
comment:1 Changed 11 years ago by
Component: | unfiled → traversing |
---|---|
Priority: | undecided → low |
comment:2 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Landed. https://github.com/jquery/jquery/commit/fbee36be16e155cc1384f34a35b455c2413ea94d
Also, sorry about the merge commit.
comment:3 Changed 11 years ago by
Remove unnecessary arguments from .nth(). Fixes #11720
Also use postfix increment to make it a little clearer.
Changeset: 4de7b5412e33331ca6f9f8a2d6e5e00dec7299f2
comment:4 Changed 11 years ago by
Merge branch 'bug11720-nth-argument' of https://github.com/sindresorhus/jquery into 1.8pre
- 'bug11720-nth-argument' of https://github.com/sindresorhus/jquery: Remove unnecessary arguments from .nth(). Fixes #11720 Changeset: fbee36be16e155cc1384f34a35b455c2413ea94d
Note: See
TracTickets for help on using
tickets.
PR: https://github.com/jquery/jquery/pull/769