Hi Tagir,
> What if it's TreeSet with custom comparator which may differentiate elements
> equal by .equals()? Or, even simpler, Collections.newSetFromMap(new
> IdentityHashMap<>())? In both cases Set.of(array) would throw.
You are right. I haven't thought about this cases. OK, then we should
at l
Hello!
What if it's TreeSet with custom comparator which may differentiate
elements equal by .equals()? Or, even simpler,
Collections.newSetFromMap(new IdentityHashMap<>())? In both cases
Set.of(array) would throw.
With best regards,
Tagir Valeev.
On Fri, Jun 22, 2018 at 4:43 PM Andrej Golovnin
> Hi all,
>
> the current implementation of Set.copyOf(Collection coll)
> creates an intermediate HashSet object to remove duplicates even when
> coll is already a Set. The attached patch adds an additional check
> whether coll is already a Set and if yes, then calls #toArray()
> directly on coll a
Hi all,
the current implementation of Set.copyOf(Collection coll)
creates an intermediate HashSet object to remove duplicates even when
coll is already a Set. The attached patch adds an additional check
whether coll is already a Set and if yes, then calls #toArray()
directly on coll and passes the