<< Back to previous view

[CLJS-582] incorrect result for (set [1 2 2]) Created: 03/Sep/13  Updated: 04/Sep/13  Resolved: 04/Sep/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Michał Marczyk
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File 0001-CLJS-582-remove-duplicates-in-output-of-cljs.core-se.patch    

 Description   

(set [1 2 2]) => #{1 2 2}



 Comments   
Comment by David Nolen [ 03/Sep/13 11:40 PM ]

The optimizations in place for set construction around IndexedSeq are not correct - they allow duplicates.

Comment by Michał Marczyk [ 04/Sep/13 12:17 AM ]

Fix with test.

Comment by David Nolen [ 04/Sep/13 12:41 AM ]

fixed, http://github.com/clojure/clojurescript/commit/95d92ba4d74a3981b0da94ae4d61adfd6df40b61

Comment by David Nolen [ 04/Sep/13 12:45 AM ]

Ooops haha Applied fix before seeing yours. I think the original code was a bit to simplistic and not worth attempting to correct as you'd just end up duplicating code written elsewhere (didn't really handle complex keys or anything like that).

Comment by Michał Marczyk [ 04/Sep/13 1:16 AM ]

Yeah, areduce is probably the better optimization. I actually like the boost to pouring larger arrays into sets that it should bring.

This made me notice some related issues; I'll file separate tickets for those.

Generated at Thu Oct 23 01:56:01 CDT 2014 using JIRA 4.4#649-r158309.