dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
97f5771
)
Shave off a few more milliseconds from cleanUp() inner loop.
author
Brion Vibber
<brion@users.mediawiki.org>
Fri, 5 Nov 2004 09:13:02 +0000
(09:13 +0000)
committer
Brion Vibber
<brion@users.mediawiki.org>
Fri, 5 Nov 2004 09:13:02 +0000
(09:13 +0000)
includes/normal/UtfNormal.php
patch
|
blob
|
history
diff --git
a/includes/normal/UtfNormal.php
b/includes/normal/UtfNormal.php
index
eee2188
..
6819b71
100644
(file)
--- a/
includes/normal/UtfNormal.php
+++ b/
includes/normal/UtfNormal.php
@@
-324,10
+324,10
@@
class UtfNormal {
# Since PHP is not the fastest language on earth, some of
# this code is a little ugly with inner loop optimizations.
# Since PHP is not the fastest language on earth, some of
# this code is a little ugly with inner loop optimizations.
- $len = strlen( $str );
- $tail =
false
;
+ $len = strlen( $str )
+ 1
;
+ $tail =
0
;
$head = '';
$head = '';
- for( $i = 0;
$i < $len; $i++
) {
+ for( $i = 0;
--$len; ++$i
) {
if( $tail ) {
if( ( $c = $str{$i} ) >= "\x80" && $c < "\xc0" ) {
$sequence .= $c;
if( $tail ) {
if( ( $c = $str{$i} ) >= "\x80" && $c < "\xc0" ) {
$sequence .= $c;
@@
-337,7
+337,7
@@
class UtfNormal {
}
# We have come to the end of the sequence...
}
# We have come to the end of the sequence...
- $tail =
false
;
+ $tail =
0
;
if( isset( $checkit[$head] ) ) {
# Do some more detailed validity checks, for
if( isset( $checkit[$head] ) ) {
# Do some more detailed validity checks, for
@@
-383,7
+383,7
@@
class UtfNormal {
echo UTF8_REPLACEMENT;
}
if( $remaining = $tailBytes[$c = $str{$i}] ) {
echo UTF8_REPLACEMENT;
}
if( $remaining = $tailBytes[$c = $str{$i}] ) {
- $tail =
true
;
+ $tail =
1
;
$sequence = $head = $c;
} elseif( $c < "\x80" ) {
echo $c;
$sequence = $head = $c;
} elseif( $c < "\x80" ) {
echo $c;