- Performance improvement: avoid copying/cloning arrays. Patch #155 by anarcat.
parent
2fa2497744
commit
875c6e3f77
|
@ -544,9 +544,10 @@ function book_toc($parent = 0, $indent = "", $toc = array()) {
|
|||
$result = db_query("SELECT n.nid, n.title, b.parent FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE n.status = '1' ORDER BY b.weight, n.title");
|
||||
|
||||
while ($node = db_fetch_object($result)) {
|
||||
$list = $children[$node->parent] ? $children[$node->parent] : array();
|
||||
array_push($list, $node);
|
||||
$children[$node->parent] = $list;
|
||||
if (!$children[$node->parent]) {
|
||||
$children[$node->parent] = array();
|
||||
}
|
||||
array_push($children[$node->parent], $node);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -544,9 +544,10 @@ function book_toc($parent = 0, $indent = "", $toc = array()) {
|
|||
$result = db_query("SELECT n.nid, n.title, b.parent FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE n.status = '1' ORDER BY b.weight, n.title");
|
||||
|
||||
while ($node = db_fetch_object($result)) {
|
||||
$list = $children[$node->parent] ? $children[$node->parent] : array();
|
||||
array_push($list, $node);
|
||||
$children[$node->parent] = $list;
|
||||
if (!$children[$node->parent]) {
|
||||
$children[$node->parent] = array();
|
||||
}
|
||||
array_push($children[$node->parent], $node);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue