Skip to content

Commit

Permalink
slight optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
Cerdic committed Apr 5, 2012
1 parent 5ce6359 commit b9805d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions class.csstidy.php
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ function parse($string) {

$this->optimise->subvalue();
if ($this->sub_value != '') {
if (substr($this->sub_value, 0, 6) == 'format') {
if (strncmp($this->sub_value,'format',6)==0) {
$format_strings = csstidy::parse_string_list(substr($this->sub_value, 7, -1));
if (!$format_strings) {
$this->sub_value = "";
Expand Down Expand Up @@ -1097,7 +1097,9 @@ function merge_css_blocks($media, $selector, $css_add) {
* @version 1.0
*/
static function is_important(&$value) {
return (!strcasecmp(substr(str_replace($GLOBALS['csstidy']['whitespace'], '', $value), -10, 10), '!important'));
return (
strpos($value,"!")!==false // quick test
AND !strcasecmp(substr(str_replace($GLOBALS['csstidy']['whitespace'], '', $value), -10, 10), '!important'));
}

/**
Expand Down

0 comments on commit b9805d1

Please sign in to comment.