Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1028996 // setDiff_bothWays

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2582L/16K).

static <A, B extends A> Set<A> setDiff_bothWays(Cl<A> a, Cl<B> b) {
  a = asSet(a);
  b = asSet(b);
  Set<A> out = similarEmptySet(a);
  fOr (A x : a)
    if (!contains(b, x))
      out.add(x);
  fOr (A x : b)
    if (!contains(a, x))
      out.add(x);
  ret out;
}

Author comment

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: 207 / 285
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1032012 - areSetsEqual