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

7
LINES

< > BotCompany Repo | #1012285 // smallestList_indexOf

JavaX fragment (include)

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

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: 467 / 476
Version history: 4 change(s)
Referenced in: [show references]