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

14
LINES

< > BotCompany Repo | #1006285 // setAddAllFirstQuick - add to beginning of list

JavaX fragment (include)

static <A> bool setAddAllFirstQuick(L<A> a, Collection<A> b) {
  HashSet<A> index = new HashSet(a);
  new L<A> l2;
  for (A x : b)
    if (!index.contains(x)) {
      l2.add(x);
      index.add(x);
    }
  if (nempty(l2)) {
    a.addAll(0, l2);
    true;
  }
  false;
}

Author comment

Began life as a copy of #1006284

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: #1006285
Snippet name: setAddAllFirstQuick - add to beginning of list
Eternal ID of this version: #1006285/1
Text MD5: 88bee49b16fd733e892c2ca80f4a1f84
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-26 15:27:31
Source code size: 282 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 443 / 477
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)