You are here

private function CSSCompression_Selectors::repeats in Advanced CSS/JS Aggregation 7

Same name and namespace in other branches
  1. 6 advagg_css_compress/css-compressor-3.x/src/lib/Selectors.inc \CSSCompression_Selectors::repeats()

Removes repeated selectors that have been comma separated

Parameters

(string) selector: CSS Selector:

1 call to CSSCompression_Selectors::repeats()
CSSCompression_Selectors::selectors in advagg_css_compress/css-compressor-3.x/src/lib/Selectors.inc
Selector specific optimizations

File

advagg_css_compress/css-compressor-3.x/src/lib/Selectors.inc, line 207

Class

CSSCompression_Selectors
CSS Compressor [VERSION] [DATE] Corey Hart @ http://www.codenothing.com

Code

private function repeats($selector) {
  $parts = preg_split($this->rcomma, $selector);
  $parts = array_flip($parts);
  $parts = array_flip($parts);
  return implode(',', $parts);
}