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

10
LINES

< > BotCompany Repo | #1006315 // uniquifyList - keep order & remove duplicates

JavaX fragment (include)

static <A> L<A> uniquifyList(Collection<A> l) {
  if (l == null) null;
  if (l(l) < 2) ret asList(l);
  new HashSet<A> set;
  new L<A> out;
  for (A a : l)
    if (set.add(a))
      out.add(a);
  ret out;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006315
Snippet name: uniquifyList - keep order & remove duplicates
Eternal ID of this version: #1006315/3
Text MD5: 61749e2c0dcd81fb33900d42235daa99
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-13 19:07:37
Source code size: 215 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 628 / 651
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1011055 - uniquify - synonym of uniquifyList - keep order & remove duplicates
#1013922 - uniquifyAndICSort
#1014476 - uniquifyCI
#1017808 - uniquifyList_identity - keep order & remove duplicates - uses ==
#1034612 - uniquifyBy
#1036546 - uniquifyInPlace - remove duplicates from list in-place