minor optimizations.

This commit is contained in:
Christopher Jeffrey 2016-05-16 02:41:52 -07:00
parent c598937e4c
commit 92d95c552c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 4 additions and 4 deletions

View File

@ -178,8 +178,8 @@ Mnemonic.prototype.createMnemonic = function createMnemonic() {
word = 0;
for (j = 0; j < 11; j++) {
i++;
oct = i / 8 | 0;
bit = i % 8;
oct = (i - bit) / 8;
word <<= 1;
word |= (entropy[oct] >>> (7 - bit)) & 1;
}

View File

@ -1673,8 +1673,8 @@ utils.write64N = function write64N(dst, num, off, be) {
assert(num <= utils.MAX_SAFE_INTEGER, 'Number exceeds 2^53-1');
hi = num / 0x100000000 | 0;
lo = num % 0x100000000;
hi = (num - lo) / 0x100000000;
if (negative) {
hi = ~hi >>> 0;
@ -1793,7 +1793,7 @@ utils.read64N = function read64N(data, off, force53, be) {
assert((hi & 0xffe00000) === 0, 'Number exceeds 2^53-1');
return (hi * 0x100000000) + lo;
return hi * 0x100000000 + lo;
};
/**

View File

@ -162,7 +162,7 @@ describe('Chain', function() {
});
});
it('should fail to mine a block with coins on a side chain', function(cb) {
it('should fail to mine a block with coins on an alternate chain', function(cb) {
mineBlock(null, cb1, function(err, block) {
assert.ifError(err);
deleteCoins(block.txs);