Skip to main content
7 events
when toggle format what by license comment
Jun 17 at 7:56 vote accept Fpasquer
Jun 15 at 16:38 history edited ggorlen CC BY-SA 4.0
add link to SO
Jun 15 at 0:35 history edited ggorlen CC BY-SA 4.0
clarify
Jun 14 at 23:51 comment added ggorlen @radarbob Intuitive as that may seem, don't think that'll help. Removing one element from a list is O(n) unless it's the back element, but you can't make that guarantee here, so that would be quadratic. Feel free to post your own answer, but I'm pretty sure this will outperform it. The only microoptimization I see here is avoiding destructuring and new allocations of each object, but I doubt that's worth it so I didn't bother mentioning it.
Jun 14 at 23:46 comment added radarbob An array of objects is being created from an array of objects. The obvious performance improvement would be to not create the new array of objects but simply remove the duplicates from the original list. All I'm saying is that without knowing the input data format, nothing definitive can be said about performance tweaking.
Jun 14 at 23:24 history edited ggorlen CC BY-SA 4.0
deleted 80 characters in body
Jun 14 at 23:18 history answered ggorlen CC BY-SA 4.0