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

11
LINES

< > BotCompany Repo | #1029066 // intersectIntArrayAndBitSet

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

Libraryless. Click here for Pure Java version (78L/1K).

static int[] intersectIntArrayAndBitSet(int[] array, BitSet bs) {
  if (array == null || bs == null) null;
  int n = array.length;
  IntBuffer out = new(n);
  for i to n: {
    int x = array[i];
    if (bs.get(x))
      out.add(x);
  }
  ret out.toArray();
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1029066
Snippet name: intersectIntArrayAndBitSet
Eternal ID of this version: #1029066/1
Text MD5: 3d836ad7f38d01470df7373e3a94d7e5
Transpilation MD5: b7e47bb55ffeaaf455a84358aae3a5dc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-18 18:56:29
Source code size: 268 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 112 / 181
Referenced in: [show references]