Changeset 2220

Show
Ignore:
Timestamp:
03/04/2008 01:22:58 PM (10 months ago)
Author:
Shadowhand
Message:

Small optimization follow up to r2219.

Files:
1 modified

Legend:

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

    r2219 r2220  
    196196                $word = current($words); 
    197197 
    198                 $similar = ''; 
    199                 for ($i = 0, $max = strlen($word); $i < $max; $i++) 
     198                for ($i = 0, $max = strlen($word); $i < $max; ++$i) 
    200199                { 
    201200                        foreach ($words as $w) 
     
    205204                                        break 2; 
    206205                        } 
    207  
    208                         $similar .= $word[$i]; 
    209206                } 
    210207 
    211208                // Return the similar text 
    212                 return $similar; 
     209                return substr($word, 0, $i); 
    213210        } 
    214211