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

7
LINES

< > BotCompany Repo | #1023468 // mergeConceptLists - by ID

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (11609L/79K).

static <A extends Concept> L<A> mergeConceptLists(Collection<A> l1, Collection<A> l2) {
  new HashSet<Long> ids;
  new L<A> out;
  for unnull (A a : l1) if (ids.add(a.id)) out.add(a);
  for unnull (A a : l2) if (ids.add(a.id)) out.add(a);
  ret out;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023468
Snippet name: mergeConceptLists - by ID
Eternal ID of this version: #1023468/1
Text MD5: bcf83755391db0b2fa1d152b92ac8ee3
Transpilation MD5: 35e362eeed478a6467eb02aa1c704f19
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-23 17:16:40
Source code size: 257 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 185 / 257
Referenced in: [show references]