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

11
LINES

< > BotCompany Repo | #1006284 // setAddAllQuick - make index first

JavaX fragment (include)

static <A> bool setAddAllQuick(Collection<A> a, Collection<A> b) {
  Set<A> index = a instanceof Set ? (Set) a : new HashSet(a);
  bool change = false;
  for (A x : unnull(b))
    if (!index.contains(x)) {
      a.add(x);
      if (index != a) index.add(x);
      change = true;
    }
  ret change;
}

Author comment

Began life as a copy of #1003016

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006284
Snippet name: setAddAllQuick - make index first
Eternal ID of this version: #1006284/3
Text MD5: 6611043917c58660616fab78eed223d2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-03 19:29:31
Source code size: 310 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 474 / 460
Version history: 2 change(s)
Referenced in: [show references]