diff options
author | Andreas Gohr <andi@splitbrain.org> | 2011-10-15 11:24:19 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2011-10-15 11:24:19 +0200 |
commit | a86cc527f2653a972a7416116630b5be5c3e380c (patch) | |
tree | 6d77f3d73abda652ec68ccaa4eee21ae7dc72951 /inc | |
parent | 46213daa86e91437d10a0bc603399f4d999b04ca (diff) | |
download | rpg-a86cc527f2653a972a7416116630b5be5c3e380c.tar.gz rpg-a86cc527f2653a972a7416116630b5be5c3e380c.tar.bz2 |
Fix performance issue in close_paragraph
Looks like a for loop is faster than array_splice
Diffstat (limited to 'inc')
-rw-r--r-- | inc/parser/handler.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 0e54425f7..24d880e2d 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -1520,7 +1520,8 @@ class Doku_Handler_Block { if(trim($content)==''){ //remove the whole paragraph - array_splice($this->calls,$i); + //array_splice($this->calls,$i); // <- this is much slower than the loop below + for($x=$ccount-1; $x>=$i; $x--) unset($this->calls[$x]); }else{ // remove ending linebreaks in the paragraph $i=count($this->calls)-1; |