minor code review

This commit is contained in:
gorhill 2017-05-19 20:22:26 -04:00
parent 853f012802
commit acf7562b0f
No known key found for this signature in database
GPG key ID: 25E1490B761470C2
2 changed files with 3 additions and 3 deletions

View file

@ -2379,7 +2379,7 @@ FilterContainer.prototype.matchAndFetchData = function(dataType, requestURL, out
FilterContainer.prototype.matchTokens = function(bucket, url) { FilterContainer.prototype.matchTokens = function(bucket, url) {
// Hostname-only filters // Hostname-only filters
var f = bucket.get(this.dotTokenHash); var f = bucket.get(this.dotTokenHash);
if ( f !== undefined && f.match() ) { if ( f !== undefined && f.match() === true ) {
this.thRegister = this.dotTokenHash; this.thRegister = this.dotTokenHash;
this.fRegister = f; this.fRegister = f;
return true; return true;

View file

@ -31,14 +31,14 @@
// - Benchmarking shows this to be a common occurrence. // - Benchmarking shows this to be a common occurrence.
// //
// https://github.com/gorhill/uBlock/issues/2630 // https://github.com/gorhill/uBlock/issues/2630
// Slice input URL into a list of integer-safe token values, instead of a list // Slice input URL into a list of safe-integer token values, instead of a list
// of substrings. The assumption is that with dealing only with numeric // of substrings. The assumption is that with dealing only with numeric
// values, less underlying memory allocations, and also as a consequence // values, less underlying memory allocations, and also as a consequence
// less work for the garbage collector down the road. // less work for the garbage collector down the road.
// Another assumption is that using a numeric-based key value for Map() is // Another assumption is that using a numeric-based key value for Map() is
// more efficient than string-based key value (but that is something I would // more efficient than string-based key value (but that is something I would
// have to benchmark). // have to benchmark).
// Benchmark for string-based tokens vs. integer-safe token values: // Benchmark for string-based tokens vs. safe-integer token values:
// https://gorhill.github.io/obj-vs-set-vs-map/tokenize-to-str-vs-to-int.html // https://gorhill.github.io/obj-vs-set-vs-map/tokenize-to-str-vs-to-int.html
µBlock.urlTokenizer = { µBlock.urlTokenizer = {