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

5
LINES

< > BotCompany Repo | #1012659 // shortestListUnlessNull2 - return shortest of 2 lists; special handling of null

JavaX fragment (include)

static <A> L<A> shortestListUnlessNull2(L<A> a, L<A> b) {
  if (a == null) ret b;
  if (b == null) ret a;
  ret l(a) < l(b) ? a : b;
}

Author comment

Began life as a copy of #1012657

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: #1012659
Snippet name: shortestListUnlessNull2 - return shortest of 2 lists; special handling of null
Eternal ID of this version: #1012659/1
Text MD5: 7516146fb0b9e751f7785bf273a0e631
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-10 00:55:16
Source code size: 138 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 442 / 473
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)