remove delete calls.
This commit is contained in:
parent
9a5f1c556d
commit
87ce4e5583
@ -583,9 +583,9 @@ Batch.prototype.write = function write(callback) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.ops.length = 0;
|
this.ops.length = 0;
|
||||||
delete this.ops;
|
this.ops = null;
|
||||||
delete this.options;
|
this.options = null;
|
||||||
delete this.tree;
|
this.tree = null;
|
||||||
|
|
||||||
utils.nextTick(callback);
|
utils.nextTick(callback);
|
||||||
|
|
||||||
@ -691,9 +691,9 @@ Iterator.prototype._end = function end() {
|
|||||||
if (!this.tree)
|
if (!this.tree)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
delete this.tree;
|
this.tree = null;
|
||||||
this.items.length = 0;
|
this.items.length = 0;
|
||||||
delete this.items;
|
this.items = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
Iterator.prototype.end = function end(callback) {
|
Iterator.prototype.end = function end(callback) {
|
||||||
|
|||||||
@ -100,7 +100,7 @@ MemBlock.prototype.getCoinbaseHeight = function getCoinbaseHeight() {
|
|||||||
|
|
||||||
MemBlock.prototype.toBlock = function toBlock() {
|
MemBlock.prototype.toBlock = function toBlock() {
|
||||||
var data = bcoin.protocol.parser.parseBlock(this.raw);
|
var data = bcoin.protocol.parser.parseBlock(this.raw);
|
||||||
delete this.raw;
|
this.raw = null;
|
||||||
return new bcoin.block(data);
|
return new bcoin.block(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -133,6 +133,8 @@ function Pool(options) {
|
|||||||
this.synced = false;
|
this.synced = false;
|
||||||
this._scheduled = false;
|
this._scheduled = false;
|
||||||
this._pendingWatch = null;
|
this._pendingWatch = null;
|
||||||
|
this._timer = null;
|
||||||
|
this._interval = null;
|
||||||
|
|
||||||
this.load = {
|
this.load = {
|
||||||
timeout: options.loadTimeout || 120000,
|
timeout: options.loadTimeout || 120000,
|
||||||
@ -436,11 +438,11 @@ Pool.prototype._startTimer = function _startTimer() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Pool.prototype._stopTimer = function _stopTimer() {
|
Pool.prototype._stopTimer = function _stopTimer() {
|
||||||
if (!this._timer)
|
if (this._timer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
clearTimeout(this._timer);
|
clearTimeout(this._timer);
|
||||||
delete this._timer;
|
this._timer = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
Pool.prototype._startInterval = function _startInterval() {
|
Pool.prototype._startInterval = function _startInterval() {
|
||||||
@ -466,11 +468,11 @@ Pool.prototype._startInterval = function _startInterval() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Pool.prototype._stopInterval = function _stopInterval() {
|
Pool.prototype._stopInterval = function _stopInterval() {
|
||||||
if (!this._interval)
|
if (this._interval == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
clearInterval(this._interval);
|
clearInterval(this._interval);
|
||||||
delete this._interval;
|
this._interval = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
Pool.prototype._addLoader = function _addLoader() {
|
Pool.prototype._addLoader = function _addLoader() {
|
||||||
|
|||||||
@ -128,9 +128,9 @@ BufferReader.prototype.endData = function endData(zeroCopy) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
BufferReader.prototype.destroy = function destroy() {
|
BufferReader.prototype.destroy = function destroy() {
|
||||||
delete this.offset;
|
this.offset = null;
|
||||||
delete this.stack;
|
this.stack = null;
|
||||||
delete this.data;
|
this.data = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1974,7 +1974,7 @@ Script.prototype.removeData = function removeData(data) {
|
|||||||
this.code.splice(index[i], 1);
|
this.code.splice(index[i], 1);
|
||||||
|
|
||||||
if (this.raw) {
|
if (this.raw) {
|
||||||
delete this.raw;
|
this.raw = null;
|
||||||
this.encode();
|
this.encode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -148,8 +148,8 @@ BufferWriter.prototype.seek = function seek(offset) {
|
|||||||
|
|
||||||
BufferWriter.prototype.destroy = function destroy() {
|
BufferWriter.prototype.destroy = function destroy() {
|
||||||
this.data.length = 0;
|
this.data.length = 0;
|
||||||
delete this.data;
|
this.data = null;
|
||||||
delete this.written;
|
this.written = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user