Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

29
LINES

< > BotCompany Repo | #1029291 // mapI_if1 - faster version of mapI

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (2547L) is out of date.

1  
sclass mapI_if1_It<A, B> extends IterableIterator<B> {
2  
  IF1<A, B> f;
3  
  Iterator<A> i;
4  
  
5  
  *() {}
6  
  *(IF1<A, B> *f, Iterator<A> *i) {}
7  
  
8  
  public bool hasNext() {
9  
    ret i.hasNext();
10  
  }
11  
  
12  
  public B next() {
13  
    ret f.get(i.next());
14  
  }
15  
  
16  
  toString {
17  
    ret formatFunctionCall('mapI_if1, f, i);
18  
  }
19  
}
20  
21  
static <A, B> ItIt<B> mapI_if1(IF1<A, B> f, Iterable<A> i) {
22  
  ret new mapI_if1_It(f, i.iterator());
23  
}
24  
25  
26  
27  
static <A, B> ItIt<B> mapI_if1(Iterable<A> i, IF1<A, B> f) {
28  
  ret mapI_if1(f, i);
29  
}

Author comment

Began life as a copy of #1004292

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1029291
Snippet name: mapI_if1 - faster version of mapI
Eternal ID of this version: #1029291/4
Text MD5: 097cada97007b87b4112514c570c9b4f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-30 00:33:29
Source code size: 524 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 244 / 352
Version history: 3 change(s)
Referenced in: [show references]