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

15
LINES

< > BotCompany Repo | #1017912 - indicesOfIC

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

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

static L<Int> indicesOfIC(L<S> l, S a) {
  new IntBuffer buf;
  for (int i = 0; i < l(l); i++)
    if (eqic(l.get(i), a))
      buf.add(i);
  ret buf.asVirtualList();
}

static <A> L<Int> indicesOfIC(S s, S x) {
  int i = -1;
  new IntBuffer buf;
  while ((i = indexOfIC(s, x, i+1)) >= 0)
    buf.add(i);
  ret buf.asVirtualList();
}

Author comment

Began life as a copy of #1004477

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017912
Snippet name: indicesOfIC
Eternal ID of this version: #1017912/3
Text MD5: b9eba914f88739c13d1d76f03fef39b1
Transpilation MD5: d32dc79a08d24110ee276f2cb5e7b737
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:03
Source code size: 347 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 193 / 222
Version history: 2 change(s)
Referenced in: [show references]