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

7
LINES

< > BotCompany Repo | #1014185 // splitAccordingToPredicate - false first, then true

JavaX fragment (include)

1  
static <A> Pair<L<A>> splitAccordingToPredicate(O pred, Collection<A> l) {
2  
  new L<A> f;
3  
  new L<A> t;
4  
  for (A a : unnull(l))
5  
    (isTrue(callF(pred, a)) ? t : f).add(a);
6  
  ret pair(f, t);
7  
}

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: #1014185
Snippet name: splitAccordingToPredicate - false first, then true
Eternal ID of this version: #1014185/1
Text MD5: b7e302c9b6f156cd336f3e0292048f5c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-15 15:20:35
Source code size: 197 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 347 / 359
Referenced in: [show references]