Libraryless. Click here for Pure Java version (2709L/16K).
1 | static <A> int lastIndexOfPred(L<A> l, IF1<A, Bool> pred) { |
2 | if (l == null) ret -1; |
3 | for (int i = l(l)-1; i >= 0; i--) |
4 | if (pred.get(l.get(i))) |
5 | ret i; |
6 | ret -1; |
7 | } |
Began life as a copy of #1006686
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030680 |
Snippet name: | lastIndexOfPred - index of last element in list that matches a predicate |
Eternal ID of this version: | #1030680/4 |
Text MD5: | 9dacbb265b5ed161d3a61b4361ddc952 |
Transpilation MD5: | 5ed5df2a44e3a31623f954ecca66ba98 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-03-03 23:54:15 |
Source code size: | 179 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 227 / 279 |
Version history: | 3 change(s) |
Referenced in: | [show references] |