Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit cf135fa

Browse files
committed
expand very simple func in-place
1 parent 6bca38d commit cf135fa

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

js/abp-hide-filters.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,11 @@ FilterContainer.prototype.add = function(s) {
457457
if ( hostname.charAt(0) !== '~' ) {
458458
applyGlobally = false;
459459
}
460-
this.addSpecificSelector(hostname, parsed);
460+
if ( hostname.slice(-2) === '.*' ) {
461+
this.addEntitySelector(hostname, parsed);
462+
} else {
463+
this.addHostnameSelector(hostname, parsed);
464+
}
461465
}
462466
if ( applyGlobally ) {
463467
this.addGenericSelector(parsed);
@@ -490,17 +494,6 @@ FilterContainer.prototype.addGenericSelector = function(parsed) {
490494

491495
/******************************************************************************/
492496

493-
FilterContainer.prototype.addSpecificSelector = function(hostname, parsed) {
494-
// rhill 2014-07-13: new filter class: entity.
495-
if ( hostname.slice(-2) === '.*' ) {
496-
this.addEntitySelector(hostname, parsed);
497-
} else {
498-
this.addHostnameSelector(hostname, parsed);
499-
}
500-
};
501-
502-
/******************************************************************************/
503-
504497
FilterContainer.prototype.addHostnameSelector = function(hostname, parsed) {
505498
// https://github.com/gorhill/uBlock/issues/145
506499
var unhide = parsed.unhide;

0 commit comments

Comments
 (0)