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).

static <A> L<A> collectWhileNotNull(IF0<A> f) {
  new L<A> l;
  if (f != null) while (true) {
    A a = f!;
    if (a == null) break;
    l.add(a);
  }
  ret l;
}

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: 217 / 299
Version history: 1 change(s)
Referenced in: [show references]