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

7
LINES

< > BotCompany Repo | #1012285 // smallestList_indexOf

JavaX fragment (include)

static int smallestList_indexOf(O l, O o) {
  if (l == null) ret -1;
  if (l cast Pair) ret eq(l.a, o) ? 0 : eq(l.b, o) ? 1 : -1;
  if (l cast T3) ret eq(l.a, o) ? 0 : eq(l.b, o) ? 1 : eq(l.c, o) ? 2 : -1;
  if (l cast O[]) ret indexOf(l, o);
  ret eq(l, o) ? 0 : -1;
}

Author comment

Began life as a copy of #1012282

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: #1012285
Snippet name: smallestList_indexOf
Eternal ID of this version: #1012285/5
Text MD5: 462605000292ed78fc1796b9acf6f14b
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:00:01
Source code size: 275 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 364 / 387
Version history: 4 change(s)
Referenced in: [show references]