1 | static <A> int[] indicesOf_array(L<A> l, A a) { |
2 | if (l == null) null; |
3 | |
4 | ifclass IContentsIndexedList |
5 | if (l cast IContentsIndexedList) |
6 | ret i.indicesOf(a); |
7 | endif |
8 | |
9 | new L<Int> x; |
10 | for (int i = 0; i < l(l); i++) |
11 | if (eq(l.get(i), a)) |
12 | x.add(i); |
13 | ret toIntArray(x); |
14 | } |
Began life as a copy of #1025514
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1025517 |
Snippet name: | indicesOf_array |
Eternal ID of this version: | #1025517/1 |
Text MD5: | 8269ab73fe6d4177f9e83b692799b9ba |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-10-01 18:15:11 |
Source code size: | 300 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 140 / 174 |
Referenced in: | [show references] |