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).

1  
static <A> ItIt<A> uniqueIterator(Iterator<A> it) {
2  
  new HashSet<A> set;
3  
  ret iff(() -> {
4  
    while licensed {
5  
      if (!it.hasNext()) ret endMarker();
6  
      A a = it.next();
7  
      if (set.add(a)) ret a;
8  
    }
9  
    ret endMarker();
10  
  });
11  
}

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: 274 / 359
Referenced in: [show references]