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

7
LINES

< > BotCompany Repo | #1011511 // smallestList_get - returns null if not in range

JavaX fragment (include)

static O smallestList_get(O l, int i) {
  if (l == null) null;
  if (l cast Pair) ret i == 0 ? l.a : i == 1 ? l.b : null;
  if (l cast T3) ret i == 0 ? l.a : i == 1 ? l.b : i == 2 ? l.c : null;
  if (l cast O[]) ret get(l, i);
  ret i == 0 ? l : null;
}

Author comment

Began life as a copy of #1011508

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1011511
Snippet name: smallestList_get - returns null if not in range
Eternal ID of this version: #1011511/4
Text MD5: d1a4a121ac17a36e24c001766f348da4
Author: stefan
Category: javax / collections
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-27 00:03:14
Source code size: 259 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 446 / 494
Version history: 3 change(s)
Referenced in: [show references]