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

9
LINES

< > BotCompany Repo | #1033979 // collectWhileNotNull

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

Libraryless. Click here for Pure Java version (41L/1K).

1  
static <A> L<A> collectWhileNotNull(IF0<A> f) {
2  
  new L<A> l;
3  
  if (f != null) while (true) {
4  
    A a = f!;
5  
    if (a == null) break;
6  
    l.add(a);
7  
  }
8  
  ret l;
9  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033979
Snippet name: collectWhileNotNull
Eternal ID of this version: #1033979/2
Text MD5: 2af6052e159d7c23aa8d577cd423f555
Transpilation MD5: c8ba314db7374bd58183f40df4208c69
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-15 04:43:42
Source code size: 170 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 218 / 300
Version history: 1 change(s)
Referenced in: [show references]