Changeset 2286

Show
Ignore:
Timestamp:
03/11/2008 01:53:11 PM (9 months ago)
Author:
Geert
Message:

Some minor optimizations in text helper

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/text.php

    r2220 r2286  
    2525                $end_char = ($end_char === NULL) ? '…' : $end_char; 
    2626 
    27                 if (trim($str) == '') 
     27                if (trim($str) === '') 
    2828                        return $str; 
    2929 
     
    3535                // Only attach the end character if the matched string is shorter 
    3636                // than the starting string. 
    37                 return rtrim($matches[0]).(strlen($matches[0]) == strlen($str) ? '' : $end_char); 
     37                return rtrim($matches[0]).(strlen($matches[0]) === strlen($str) ? '' : $end_char); 
    3838        } 
    3939 
     
    5353                $limit = (int) $limit; 
    5454 
    55                 if (trim($str) == '' OR utf8::strlen($str) <= $limit) 
     55                if (trim($str) === '' OR utf8::strlen($str) <= $limit) 
    5656                        return $str; 
    5757 
     
    7979                static $i; 
    8080 
    81                 if (func_num_args() == 0) 
     81                if (func_num_args() === 0) 
    8282                { 
    8383                        $i = 0;