expand very simple func in-place

This commit is contained in:
gorhill 2014-08-14 20:00:44 -04:00
parent 6bca38d4dd
commit cf135fa736

View file

@ -457,7 +457,11 @@ FilterContainer.prototype.add = function(s) {
if ( hostname.charAt(0) !== '~' ) { if ( hostname.charAt(0) !== '~' ) {
applyGlobally = false; applyGlobally = false;
} }
this.addSpecificSelector(hostname, parsed); if ( hostname.slice(-2) === '.*' ) {
this.addEntitySelector(hostname, parsed);
} else {
this.addHostnameSelector(hostname, parsed);
}
} }
if ( applyGlobally ) { if ( applyGlobally ) {
this.addGenericSelector(parsed); this.addGenericSelector(parsed);
@ -490,17 +494,6 @@ FilterContainer.prototype.addGenericSelector = function(parsed) {
/******************************************************************************/ /******************************************************************************/
FilterContainer.prototype.addSpecificSelector = function(hostname, parsed) {
// rhill 2014-07-13: new filter class: entity.
if ( hostname.slice(-2) === '.*' ) {
this.addEntitySelector(hostname, parsed);
} else {
this.addHostnameSelector(hostname, parsed);
}
};
/******************************************************************************/
FilterContainer.prototype.addHostnameSelector = function(hostname, parsed) { FilterContainer.prototype.addHostnameSelector = function(hostname, parsed) {
// https://github.com/gorhill/uBlock/issues/145 // https://github.com/gorhill/uBlock/issues/145
var unhide = parsed.unhide; var unhide = parsed.unhide;