Bug Tracker


Ticket #1384 (closed bug: wontfix)

Opened 7 years ago

Last modified 7 years ago

$.merge() doesn't remove all dupes in 1.1.3

Reported by: Raze Owned by:
Priority: major Milestone: 1.1.4
Component: core Version: 1.1.3
Keywords: Cc:
Blocking: Blocked by:


I frequently use $.merge to remove duplicate elements in arrays. Before upgrading to 1.1.3, this worked perfectly on my URIencoded strings. Now it misses most (but not all) of the duplicates, and I get arrays with numerous consecutive duplicates values, as well as scattered ones. Example: $.merge(this.optionItems, this.searchObj.targets[i][plugin.field].split(","));

Returning the result of $.merge into the target array (this.optionItems) makes no difference.

When I switched my jQuery back to 1.1.2, it worked with no problems.

Change History

comment:1 Changed 7 years ago by john

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

@Raze: This is correct. In 1.1.3 we switched to a two method system. $.merge() combines arrays (that is it, doesn't remove duplicates) and $.unique() removed duplicates. We found this to be much faster, since you could merge many arrays then do a single unique operation on them. Hope this helps!

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


Add a comment

Modify Ticket

as closed

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

Note: See TracTickets for help on using tickets.