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

9
LINES

< > BotCompany Repo | #1010704 // nodesToWebs_max - preserves order, drops duplicates, stop at number

JavaX fragment (include)

static L<Web> nodesToWebs_max(Collection<WebNode> nodes, int max) {
  Set<Web> webs = litorderedset();
  for (WebNode node : nodes) {
    webs.add(node.web);
    if (l(webs) >= max)
      break;
  }
  ret asList(webs);
}

Author comment

Began life as a copy of #1010703

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: #1010704
Snippet name: nodesToWebs_max - preserves order, drops duplicates, stop at number
Eternal ID of this version: #1010704/1
Text MD5: 13285665782c23ff1ebdbdd20d55db61
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-27 16:22:55
Source code size: 228 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 351 / 414
Referenced in: [show references]