pie icon indicating copy to clipboard operation
pie copied to clipboard

Stable Unique

Open Deleplace opened this issue 6 years ago • 3 comments

Unique can be modified at no extra cost to keep the original ordering of the elements. This would seem a sensible default to me.

Shall I write the code and make a PR?

Deleplace avatar May 04 '19 09:05 Deleplace

By the way, thank you again for Pie. I really love the project.

Deleplace avatar May 04 '19 09:05 Deleplace

(edited) Hey @Deleplace, nice offer that's worth to do, as I supposed. But it has been documented here I've been pondering about that, and I've not found any case where it would be important, in fact. Anyway, I consider it really seems as default behaviour

zhiburt avatar May 04 '19 11:05 zhiburt

I'm impartial either way. I think that performance is more important than retaining the input order. That being said if there is no cost to performance then retaining input order can't be any less useful that randomising the order.

I expect that Unique() would be paired with Sort(), etc if the order matters.

elliotchance avatar May 05 '19 10:05 elliotchance