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

5
LINES

< > BotCompany Repo | #1031152 // setBit_trueIfChanged

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

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

sbool setBit_trueIfChanged(BitSet b, int bit, bool value default true) {
  if (b == null || b.get(bit) == value) false;
  b.set(bit, value);
  true;
}

Author comment

Began life as a copy of #1014003

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031152
Snippet name: setBit_trueIfChanged
Eternal ID of this version: #1031152/3
Text MD5: c3771e797c2004dee2eb6bb1084d20c4
Transpilation MD5: 5e65e4f7226fcc6db3efe066167d9752
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-13 17:14:57
Source code size: 154 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 74 / 115
Version history: 2 change(s)
Referenced in: [show references]