Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update bitview.js

  • Loading branch information...
commit 3ed7ab1d343eb7dcf14858b1f782f3834a53d59d 1 parent 0006ccc
@kig authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 bitview.js
View
6 bitview.js
@@ -10,13 +10,11 @@ BitView.prototype.getBit = function(idx) {
};
BitView.prototype.setBit = function(idx, val) {
- var bidx = idx >> 3;
- var v = this.u8[bidx];
var off = idx & 0x7;
if (val) {
- this.u8[bidx] = v | (0x80 >> off);
+ this.u8[idx >> 3] |= (0x80 >> off);
} else {
- this.u8[bidx] = v & ~(0x80 >> off);
+ this.u8[idx >> 3] &= ~(0x80 >> off);
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.