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)

1  
static <A> L<A> uniquifyList(Collection<A> l) {
2  
  if (l == null) null;
3  
  if (l(l) < 2) ret asList(l);
4  
  new HashSet<A> set;
5  
  new L<A> out;
6  
  for (A a : l)
7  
    if (set.add(a))
8  
      out.add(a);
9  
  ret out;
10  
}

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: 629 / 652
Version history: 2 change(s)
Referenced in: [show references]