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

15
LINES

< > BotCompany Repo | #1029941 // indicesOfIC_array

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

Libraryless. Click here for Pure Java version (2986L/19K).

1  
static int[] indicesOfIC_array(L<S> l, S a) {
2  
  new IntBuffer buf;
3  
  for (int i = 0; i < l(l); i++)
4  
    if (eqic(l.get(i), a))
5  
      buf.add(i);
6  
  ret buf.toArray();
7  
}
8  
9  
static <A> int[] indicesOfIC_array(S s, S x) {
10  
  int i = -1;
11  
  new IntBuffer buf;
12  
  while ((i = indexOfIC(s, x, i+1)) >= 0)
13  
    buf.add(i);
14  
  ret buf.toArray();
15  
}

Author comment

Began life as a copy of #1017912

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1029941
Snippet name: indicesOfIC_array
Eternal ID of this version: #1029941/1
Text MD5: 8508b041f36628e2145cd22d4a913bd2
Transpilation MD5: 7668efeb596c3e92b063537ea4a58822
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-10-13 15:46:52
Source code size: 345 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 165 / 233
Referenced in: [show references]