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

1  
static int[] intersectIntArrayAndBitSet(int[] array, BitSet bs) {
2  
  if (array == null || bs == null) null;
3  
  int n = array.length;
4  
  IntBuffer out = new(n);
5  
  for i to n: {
6  
    int x = array[i];
7  
    if (bs.get(x))
8  
      out.add(x);
9  
  }
10  
  ret out.toArray();
11  
}

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