mirror of https://github.com/gorhill/uBlock.git
code review
This commit is contained in:
parent
4a5938d3dd
commit
d639c63670
|
@ -123,7 +123,7 @@ var renderLogBuffer = function(buffer) {
|
|||
/******************************************************************************/
|
||||
|
||||
var onBufferRead = function(buffer) {
|
||||
if ( Array.isArray(buffer ) ) {
|
||||
if ( Array.isArray(buffer) ) {
|
||||
renderLogBuffer(buffer);
|
||||
}
|
||||
setTimeout(readLogBuffer, 1000);
|
||||
|
@ -142,13 +142,8 @@ var readLogBuffer = function() {
|
|||
/******************************************************************************/
|
||||
|
||||
var clearBuffer = function() {
|
||||
var rows = tbody.rows;
|
||||
var row;
|
||||
var i = rows.length;
|
||||
while ( i-- ) {
|
||||
row = rows[i];
|
||||
row.parentNode.removeChild(row);
|
||||
rowJunkyard.push(row);
|
||||
while ( tbody.firstChild !== null ) {
|
||||
rowJunkyard.push(tbody.removeChild(tbody.firstChild));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ LogBuffer.prototype.writeOne = function(details, result) {
|
|||
if ( this.writePtr === this.readPtr ) {
|
||||
var toMove = this.buffer.slice(0, this.writePtr);
|
||||
var minSize = Math.ceil(this.size * 1.5);
|
||||
this.size += this.writePtr;
|
||||
this.size += toMove.length;
|
||||
if ( this.size < minSize ) {
|
||||
this.buffer = this.buffer.concat(toMove, new Array(minSize - this.size));
|
||||
this.writePtr = this.size;
|
||||
|
|
Loading…
Reference in New Issue