Libraryless. Click here for Pure Java version (4520L/25K).
1 | // possible binary legacy signature |
2 | static <A> L<Pair<A>> listToPairs(L<A> l) { |
3 | ret listToPairs((Iterable<A>) l); |
4 | } |
5 | |
6 | static <A> L<Pair<A>> listToPairs(Iterable<A> or A[] l) { |
7 | new LPair<A> out; |
8 | Iterator<A> it = iterator(l); |
9 | while ping (it.hasNext()) { |
10 | A a = it.next(); |
11 | if (!it.hasNext()) break; |
12 | A b = it.next(); |
13 | addPair(out, a, b); |
14 | } |
15 | ret out; |
16 | } |
Began life as a copy of #1012216
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1012218 |
Snippet name: | listToPairs - group elements in pairs; drops last element if single |
Eternal ID of this version: | #1012218/4 |
Text MD5: | 87ccfde7637fdfc696b72775b8e7237e |
Transpilation MD5: | e75d8f7c27c7d00977a81a48b82a8730 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-25 01:59:44 |
Source code size: | 387 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 504 / 595 |
Version history: | 3 change(s) |
Referenced in: | [show references] |