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

15
LINES

< > BotCompany Repo | #1015558 // concatListsToSet (HashSet)

JavaX fragment (include)

1  
static <A> HashSet<A> concatListsToSet(Collection<A>... lists) {
2  
  new HashSet<A> l;
3  
  for (Collection<A> list : lists)
4  
    if (list != null)
5  
      l.addAll(list);
6  
  return l;
7  
}
8  
9  
static <A> HashSet<A> concatListsToSet(Collection<? extends Collection<A>> lists) {
10  
  new HashSet<A> l;
11  
  for (Collection<A> list : lists)
12  
    if (list != null)
13  
      l.addAll(list);
14  
  return l;
15  
}

Author comment

Began life as a copy of #1001241

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: #1015558
Snippet name: concatListsToSet (HashSet)
Eternal ID of this version: #1015558/1
Text MD5: 8a4564a7e2a1ad1ef570583ed18bf84d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-17 14:05:22
Source code size: 391 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 418 / 465
Referenced in: [show references]