iliaa Thu May 27 17:34:36 2004 EDT
Modified files: /livedocs xml_classes5.php Log: Inline compress() method, another 100+ method calls per page down. http://cvs.php.net/diff.php/livedocs/xml_classes5.php?r1=1.8&r2=1.9&ty=u Index: livedocs/xml_classes5.php diff -u livedocs/xml_classes5.php:1.8 livedocs/xml_classes5.php:1.9 --- livedocs/xml_classes5.php:1.8 Thu May 27 17:31:19 2004 +++ livedocs/xml_classes5.php Thu May 27 17:34:36 2004 @@ -19,7 +19,7 @@ // | PHP 5 style | // +----------------------------------------------------------------------+ // -// $Id: xml_classes5.php,v 1.8 2004/05/27 21:31:19 iliaa Exp $ +// $Id: xml_classes5.php,v 1.9 2004/05/27 21:34:36 iliaa Exp $ class Node { /* {{{ */ @@ -141,14 +141,6 @@ //@$GLOBALS['__node_count']++; } - function compress() - { - if ((isset($this->children[0]) && !isset($this->children[1])) && $this->children[0]->tagname == '') { - $this->content = $this->children[0]->content; - $this->children = array(); - } - } - function as_xml() { if (!$this->tagname) { @@ -350,7 +342,10 @@ } /* optimize the node; if it only contains a single cdata (anonymous) node, * compress that node into the content */ - $this->current->compress(); + if ((isset($this->children[0]) && !isset($this->children[1])) && $this->children[0]->tagname == '') { + $this->content = $this->children[0]->content; + $this->children = array(); + } $this->current = $this->current->parent; }