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

16
LINES

< > BotCompany Repo | #1008343 // asLinkedHashSet

JavaX fragment (include)

static <A> LinkedHashSet<A> asLinkedHashSet(A[] array) {
  new LinkedHashSet<A> set;
  for (A o : array)
    if (o != null)
      set.add(o);
  ret set;
}

static <A> LinkedHashSet<A> asLinkedHashSet(Collection<A> l) {
  if (l instanceof LinkedHashSet) ret (LinkedHashSet) l;
  new LinkedHashSet<A> set;
  for (A o : l)
    if (o != null)
      set.add(o);
  ret set;
}

Author comment

Began life as a copy of #1001899

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008343
Snippet name: asLinkedHashSet
Eternal ID of this version: #1008343/4
Text MD5: ed629794d2babc0d65ac4039378d73e0
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-08 01:22:25
Source code size: 384 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 423 / 457
Version history: 3 change(s)
Referenced in: [show references]