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

8
LINES

< > BotCompany Repo | #1036002 // filterAntiFilterByBitSet - takes a byte array as the bit set

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

Transpiled version (9247L) is out of date.

static <A> Pair<L<A>> filterAntiFilterByBitSet(L<A> list, byte[] bitSet) {
  int n = l(list), nSet = bitCount(bitSet);
  L<A> l1 = emptyList(nSet);
  L<A> l2 = emptyList(n-nSet);
  for i to n:
    (getBit(bitSet, i) ? l1 : l2).add(list.get(i));
  ret pair(l1, l2);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1036002
Snippet name: filterAntiFilterByBitSet - takes a byte array as the bit set
Eternal ID of this version: #1036002/3
Text MD5: f3166430121a345680f0e39e0c7b6e32
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-23 15:07:34
Source code size: 273 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 136 / 171
Version history: 2 change(s)
Referenced in: [show references]