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

11
LINES

< > BotCompany Repo | #1024860 // uniqueIterator

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

Libraryless. Click here for Pure Java version (1760L/12K).

static <A> ItIt<A> uniqueIterator(Iterator<A> it) {
  new HashSet<A> set;
  ret iff(() -> {
    while licensed {
      if (!it.hasNext()) ret endMarker();
      A a = it.next();
      if (set.add(a)) ret a;
    }
    ret endMarker();
  });
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1024860
Snippet name: uniqueIterator
Eternal ID of this version: #1024860/1
Text MD5: 499cfa66ba9d65d18e0c2271afbae3be
Transpilation MD5: e70b139c533b87b5a642b1642ea869dc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-27 17:23:25
Source code size: 251 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 273 / 358
Referenced in: [show references]