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;
|
||||
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) {
|
||||
|
||||
@ -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);
|
||||
};
|
||||
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user