Skip to content

Commit bc03672

Browse files
committed
code review (gorhill#3208)
1 parent f7bfcff commit bc03672

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

src/js/traffic.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,23 +304,18 @@ var onBeforeRootFrameRequest = function(details) {
304304

305305
// https://github.com/gorhill/uBlock/issues/3208
306306
// Mind case insensitivity.
307+
307308
var toBlockDocResult = function(url, hostname, logData) {
308-
if ( typeof logData.regex !== 'string' ) { return; }
309+
if ( typeof logData.regex !== 'string' ) { return false; }
309310
var re = new RegExp(logData.regex, 'i'),
310311
match = re.exec(url.toLowerCase());
311312
if ( match === null ) { return false; }
312313

313314
// https://github.com/chrisaljoudi/uBlock/issues/1128
314315
// https://github.com/chrisaljoudi/uBlock/issues/1212
315316
// Relax the rule: verify that the match is completely before the path part
316-
if (
317-
(match.index + match[0].length) <=
318-
(url.indexOf(hostname) + hostname.length + 1)
319-
) {
320-
return true;
321-
}
322-
323-
return false;
317+
return (match.index + match[0].length) <=
318+
(url.indexOf(hostname) + hostname.length + 1);
324319
};
325320

326321
/******************************************************************************/

0 commit comments

Comments
 (0)