1 | static <A> L<A> takeFirst_lazy(L<A> l, int n) { |
2 | ret l(l) <= n ? l : subList(l, 0, n); |
3 | } |
4 | |
5 | static <A> L<A> takeFirst_lazy(int n, L<A> l) { |
6 | ret takeFirst_lazy(l, n); |
7 | } |
8 | |
9 | static <A> L<A> takeFirst_lazy(int n, Iterable<A> i) { |
10 | ret takeFirst(n, i); |
11 | } |
Began life as a copy of #1007549
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1021957 |
Snippet name: | takeFirst_lazy function (take first n elements of a list; use standard .subList) |
Eternal ID of this version: | #1021957/1 |
Text MD5: | 9ac7ede01545fcc692687f38ea34fd21 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-04 10:29:24 |
Source code size: | 261 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 230 / 267 |
Referenced in: | [show references] |