Libraryless. Click here for Pure Java version (2511L/16K).
1 | static <A> Set<A> setIntersection(Cl<A> a, Cl<A> b) {
|
2 | Set<A> set = similarEmptySet(a); |
3 | if (nempty(a) && nempty(b)) {
|
4 | Set<A> bSet = asSet(b); |
5 | for (A x : a) if (bSet.contains(x)) set.add(x); |
6 | } |
7 | ret set; |
8 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1009544 |
| Snippet name: | setIntersection |
| Eternal ID of this version: | #1009544/6 |
| Text MD5: | 9c4f2ff220cb6ffcd49664c8eec91381 |
| Transpilation MD5: | 6058ea57672f59e6d2caae65a993e48d |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-07-17 17:13:15 |
| Source code size: | 224 bytes / 8 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 981 / 1217 |
| Version history: | 5 change(s) |
| Referenced in: | [show references] |