From d437bcc4a25f62fad65e625f4bc13cab8873f994 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 18 Sep 2005 14:10:08 +0200 Subject: more efficient changelog reading for recent changes getRecents now reads the changelog backwards in 4KB chunks instead of loading the whole file into an array and rsort it. This should be more memory efficient (and probably faster) for large change logs. Note: the format of the array returned by getRecents changed slightly plugins relying on it need to be adjusted. Sorry. darcs-hash:20050918121008-7ad00-1fdba47d29b0c038c6e4e4edc1d4c93e5ba769e9.gz --- inc/indexer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/indexer.php') diff --git a/inc/indexer.php b/inc/indexer.php index 2bc707269..fe8e74bd9 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -34,7 +34,7 @@ function idx_getPageWords($page){ $body = strtr($body, "\r\n\t", ' '); $tokens = explode(' ', $body); $tokens = array_count_values($tokens); // count the frequency of each token - + $words = array(); foreach ($tokens as $word => $count) { @@ -54,7 +54,7 @@ function idx_getPageWords($page){ $words[$word] = $count + (isset($words[$word]) ? $words[$word] : 0); } } - + // arrive here with $words = array(word => frequency) $index = array(); //resulting index -- cgit v1.2.3