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

10
LINES

< > BotCompany Repo | #1017808 // uniquifyList_identity - keep order & remove duplicates - uses ==

JavaX fragment (include)

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

Author comment

Began life as a copy of #1006315

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017808
Snippet name: uniquifyList_identity - keep order & remove duplicates - uses ==
Eternal ID of this version: #1017808/1
Text MD5: 4ac14757d6ea0b528bbcb72b917345e7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-14 11:58:19
Source code size: 236 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 317 / 358
Referenced in: [show references]