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

7
LINES

< > BotCompany Repo | #1020586 // bitSetToIntList

JavaX fragment (include)

1  
static L<Int> bitSetToIntList(BitSet bs) {
2  
  if (bs == null) null;
3  
  L<Int> l = emptyList(bitCount(bs));
4  
  for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i+1))
5  
    l.add(i);
6  
  ret l;
7  
}

Author comment

Began life as a copy of #1006139

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020586
Snippet name: bitSetToIntList
Eternal ID of this version: #1020586/3
Text MD5: 225a5097383ddb913584d14df75f5b8f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-27 17:35:57
Source code size: 200 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 281 / 308
Version history: 2 change(s)
Referenced in: [show references]