1 | static <A> IterableIterator<A> iteratorFromFunction_f0(final F0<A> f) { |
2 | class IFF2 extends IterableIterator<A> { |
3 | A a; |
4 | bool done; |
5 | |
6 | public bool hasNext() { |
7 | getNext(); |
8 | ret !done; |
9 | } |
10 | |
11 | public A next() { |
12 | getNext(); |
13 | if (done) fail(); |
14 | A _a = a; |
15 | a = null; |
16 | ret _a; |
17 | } |
18 | |
19 | void getNext() { |
20 | if (done || a != null) ret; |
21 | a = f.get(); |
22 | done = a == null; |
23 | } |
24 | }; |
25 | ret new IFF2; |
26 | } |
Began life as a copy of #1006726
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: | #1012440 |
Snippet name: | iteratorFromFunction_f0 - ends on null |
Eternal ID of this version: | #1012440/3 |
Text MD5: | 51477e747893ff2cdcb5e12b0ada6ef2 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-28 19:40:51 |
Source code size: | 488 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 473 / 476 |
Version history: | 2 change(s) |
Referenced in: | [show references] |