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.

sclass mapI_if1_It<A, B> extends IterableIterator<B> {
  IF1<A, B> f;
  Iterator<A> i;
  
  *() {}
  *(IF1<A, B> *f, Iterator<A> *i) {}
  
  public bool hasNext() {
    ret i.hasNext();
  }
  
  public B next() {
    ret f.get(i.next());
  }
  
  toString {
    ret formatFunctionCall('mapI_if1, f, i);
  }
}

static <A, B> ItIt<B> mapI_if1(IF1<A, B> f, Iterable<A> i) {
  ret new mapI_if1_It(f, i.iterator());
}



static <A, B> ItIt<B> mapI_if1(Iterable<A> i, IF1<A, B> f) {
  ret mapI_if1(f, i);
}

Author comment

Began life as a copy of #1004292

download  show line numbers  debug dex   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, 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: 44 / 82
Version history: 3 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1029291 & http://1029291.tinybrain.de