Bug Tracker

Modify

Ticket #8814 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Unnecessary code in inArray

Reported by: timmywil Owned by: timmywil
Priority: low Milestone: 1.next
Component: core Version: 1.5.2
Keywords: Cc:
Blocking: Blocked by:

Description

I was looking through core.js and noticed the redefinition of inArray using indexOf if it exists. Since this overrides the function, we don't need to check for indexOf in the fallback inArray definition.  pull request

Change History

comment:1 Changed 3 years ago by timmywil

  • Owner set to timmywil
  • Priority changed from undecided to low
  • Status changed from new to assigned
  • Component changed from unfiled to core

comment:2 Changed 3 years ago by rwaldron

Building on timmywil's commit, I reduced the codesize further, with negligible performance loss:

 https://github.com/jquery/jquery/pull/308

 http://jsperf.com/init-time-vs-on-call

Last edited 3 years ago by rwaldron (previous) (diff)

comment:3 Changed 3 years ago by Rick Waldron

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixes #8814. Clean up inArray.

Changeset: 8c40c00fac2f30fa0804ae8097642636f9718ddd

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.