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

14
LINES

< > BotCompany Repo | #1023246 // indicesOfAny

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

Libraryless. Click here for Pure Java version (1483L/10K).

1  
static <A> L<Int> indicesOfAny(L<A> l, Set<A> set) {
2  
  ret indicesOfAny(l, set, 0);
3  
}
4  
5  
static <A> L<Int> indicesOfAny(L<A> l, Set<A> set, int startIdx) {
6  
  new L<Int> x;
7  
  if (nempty(set)) {
8  
    int n = l(l);
9  
    for (int i = startIdx; i < n; i++)
10  
      if (set.contains(l.get(i)))
11  
        x.add(i);
12  
  }
13  
  ret x;
14  
}

Author comment

Began life as a copy of #1017945

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1023246
Snippet name: indicesOfAny
Eternal ID of this version: #1023246/3
Text MD5: d42663ef576d79c6c542a148d5a231d3
Transpilation MD5: 78e4c4d2cd117bc6f74de261bef70c88
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-19 13:22:34
Source code size: 327 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 262 / 350
Version history: 2 change(s)
Referenced in: [show references]