remove delete calls.

This commit is contained in:
Christopher Jeffrey 2016-06-13 02:43:19 -07:00
parent 9a5f1c556d
commit 87ce4e5583
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
6 changed files with 18 additions and 16 deletions

View File

@ -583,9 +583,9 @@ Batch.prototype.write = function write(callback) {
});
this.ops.length = 0;
delete this.ops;
delete this.options;
delete this.tree;
this.ops = null;
this.options = null;
this.tree = null;
utils.nextTick(callback);
@ -691,9 +691,9 @@ Iterator.prototype._end = function end() {
if (!this.tree)
return;
delete this.tree;
this.tree = null;
this.items.length = 0;
delete this.items;
this.items = null;
};
Iterator.prototype.end = function end(callback) {

View File

@ -100,7 +100,7 @@ MemBlock.prototype.getCoinbaseHeight = function getCoinbaseHeight() {
MemBlock.prototype.toBlock = function toBlock() {
var data = bcoin.protocol.parser.parseBlock(this.raw);
delete this.raw;
this.raw = null;
return new bcoin.block(data);
};

View File

@ -133,6 +133,8 @@ function Pool(options) {
this.synced = false;
this._scheduled = false;
this._pendingWatch = null;
this._timer = null;
this._interval = null;
this.load = {
timeout: options.loadTimeout || 120000,
@ -436,11 +438,11 @@ Pool.prototype._startTimer = function _startTimer() {
};
Pool.prototype._stopTimer = function _stopTimer() {
if (!this._timer)
if (this._timer == null)
return;
clearTimeout(this._timer);
delete this._timer;
this._timer = null;
};
Pool.prototype._startInterval = function _startInterval() {
@ -466,11 +468,11 @@ Pool.prototype._startInterval = function _startInterval() {
};
Pool.prototype._stopInterval = function _stopInterval() {
if (!this._interval)
if (this._interval == null)
return;
clearInterval(this._interval);
delete this._interval;
this._interval = null;
};
Pool.prototype._addLoader = function _addLoader() {

View File

@ -128,9 +128,9 @@ BufferReader.prototype.endData = function endData(zeroCopy) {
*/
BufferReader.prototype.destroy = function destroy() {
delete this.offset;
delete this.stack;
delete this.data;
this.offset = null;
this.stack = null;
this.data = null;
};
/**

View File

@ -1974,7 +1974,7 @@ Script.prototype.removeData = function removeData(data) {
this.code.splice(index[i], 1);
if (this.raw) {
delete this.raw;
this.raw = null;
this.encode();
}

View File

@ -148,8 +148,8 @@ BufferWriter.prototype.seek = function seek(offset) {
BufferWriter.prototype.destroy = function destroy() {
this.data.length = 0;
delete this.data;
delete this.written;
this.data = null;
this.written = null;
};
/**