public/ckeditor/4.4dev/core/filter.js
function optimizeRules( optimizedRules, rules ) {
		var elementsRules = optimizedRules.elements,
			genericRules = optimizedRules.generic,
			i, l, rule, element, priority;

		for ( i = 0, l = rules.length; i < l; ++i ) {
			// Shallow copy. Do not modify original rule.
			rule = copy( rules[ i ] );
			priority = rule.classes === true || rule.styles === true || rule.attributes === true;
			optimizeRule( rule );

			// E.g. "*(xxx)[xxx]" - it's a generic rule that
			// validates properties only.
			// Or '$1': { match: function() {...} }
			if ( rule.elements === true || rule.elements === null ) {
				// Add priority rules at the beginning.
				genericRules[ priority ? 'unshift' : 'push' ]( rule );
			}
			// If elements list was explicitly defined,
			// add this rule for every defined element.
			else {
				// We don't need elements validator for this kind of rule.
				var elements = rule.elements;
				delete rule.elements;

				for ( element in elements ) {
					if ( !elementsRules[ element ] )
						elementsRules[ element ] = [ rule ];
					else
						elementsRules[ element ][ priority ? 'unshift' : 'push' ]( rule );
				}
			}
		}
	}
function optimizeRules( optimizedRules, rules ) {
		var elementsRules = optimizedRules.elements,
			genericRules = optimizedRules.generic,
			i, l, rule, element, priority;

		for ( i = 0, l = rules.length; i < l; ++i ) {
			// Shallow copy. Do not modify original rule.
			rule = copy( rules[ i ] );
			priority = rule.classes === true || rule.styles === true || rule.attributes === true;
			optimizeRule( rule );

			// E.g. "*(xxx)[xxx]" - it's a generic rule that
			// validates properties only.
			// Or '$1': { match: function() {...} }
			if ( rule.elements === true || rule.elements === null ) {
				// Add priority rules at the beginning.
				genericRules[ priority ? 'unshift' : 'push' ]( rule );
			}
			// If elements list was explicitly defined,
			// add this rule for every defined element.
			else {
				// We don't need elements validator for this kind of rule.
				var elements = rule.elements;
				delete rule.elements;

				for ( element in elements ) {
					if ( !elementsRules[ element ] )
						elementsRules[ element ] = [ rule ];
					else
						elementsRules[ element ][ priority ? 'unshift' : 'push' ]( rule );
				}
			}
		}
	}
function optimizeRules ( optimizedRules , rules ) { var elementsRules = optimizedRules . elements , genericRules = optimizedRules . generic , i , l , rule , element , priority ; for ( i = 0 , l = rules . length ; i < l ; ++ i ) { // Shallow copy. Do not modify original rule. rule = copy ( rules [ i ] ) ; priority = rule . classes === true || rule . styles === true || rule . attributes === true ; optimizeRule ( rule ) ; // E.g. "*(xxx)[xxx]" - it's a generic rule that // validates properties only. // Or '$1': { match: function() {...} } if ( rule . elements === true || rule . elements === null ) { // Add priority rules at the beginning. genericRules [ priority ? 'unshift' : 'push' ] ( rule ) ; } // If elements list was explicitly defined, // add this rule for every defined element. else { // We don't need elements validator for this kind of rule. var elements = rule . elements ; delete rule . elements ; for ( element in elements ) { if ( ! elementsRules [ element ] ) elementsRules [ element ] = [ rule ] ; else elementsRules [ element ] [ priority ? 'unshift' : 'push' ] ( rule ) ; } } } }
Add optimized version of rule to optimizedRules object.
Add optimized version of rule to optimizedRules object .