1 | static <A, B extends A> Collection<A> collectionMinusSet(Collection<A> l, Collection<B> stuff) { |
2 | if (empty(stuff)) ret l; |
3 | Set<B> set = asSet(stuff); |
4 | Collection<A> l2 = similarEmptyCollection(l); |
5 | for (A a : l) if (!set.contains(a)) l2.add(a); |
6 | ret l2; |
7 | } |
Began life as a copy of #1007796
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1022634 |
Snippet name: | collectionMinusSet - collection minus some elements |
Eternal ID of this version: | #1022634/1 |
Text MD5: | da61d5f23e3537ca0297a77d27cef5c4 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-25 13:40:51 |
Source code size: | 267 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 260 / 308 |
Referenced in: | [show references] |