Libraryless. Click here for Pure Java version (2582L/16K).
1 | static <A, B extends A> Set<A> setDiff_bothWays(Cl<A> a, Cl<B> b) { |
2 | a = asSet(a); |
3 | b = asSet(b); |
4 | Set<A> out = similarEmptySet(a); |
5 | fOr (A x : a) |
6 | if (!contains(b, x)) |
7 | out.add(x); |
8 | fOr (A x : b) |
9 | if (!contains(a, x)) |
10 | out.add(x); |
11 | ret out; |
12 | } |
Began life as a copy of #1021440
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028996 |
Snippet name: | setDiff_bothWays |
Eternal ID of this version: | #1028996/1 |
Text MD5: | 7cfeb8698e1755c54a100fc6a3d1a79b |
Transpilation MD5: | 6234d3408d904529ccc0d10e334f3ae1 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-07-16 17:52:33 |
Source code size: | 276 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 206 / 285 |
Referenced in: | [show references] |