1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-23 10:52:43 +01:00

minor code review

This commit is contained in:
gorhill 2016-08-16 08:42:12 -04:00
parent a9ec0a1c7b
commit 07d15ae817

View File

@ -2016,7 +2016,7 @@ var httpObserver = {
}
}
bucket = this.pendingURLToIndex.get(url);
this.pendingURLToIndex.set(url, bucket === undefined ? si : bucket + si);
this.pendingURLToIndex.set(url, bucket === undefined ? si : si + bucket);
preq._key = url;
return preq;
},
@ -2026,11 +2026,11 @@ var httpObserver = {
if ( bucket === undefined ) {
return null;
}
var i = bucket.charCodeAt(bucket.length - 1);
var i = bucket.charCodeAt(0);
if ( bucket.length === 1 ) {
this.pendingURLToIndex.delete(url);
} else {
this.pendingURLToIndex.set(url, bucket.slice(0, -1));
this.pendingURLToIndex.set(url, bucket.slice(1));
}
var preq = this.pendingRingBuffer[i];
preq._key = ''; // mark as "serviced"