diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-09-18 14:10:08 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-09-18 14:10:08 +0200 |
commit | d437bcc4a25f62fad65e625f4bc13cab8873f994 (patch) | |
tree | 8036cb2794b499b87ff9d3a193148e181e9a8914 /inc/indexer.php | |
parent | b7af031cf80338a83187f1fb75cfacf0bb24c103 (diff) | |
download | rpg-d437bcc4a25f62fad65e625f4bc13cab8873f994.tar.gz rpg-d437bcc4a25f62fad65e625f4bc13cab8873f994.tar.bz2 |
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
Diffstat (limited to 'inc/indexer.php')
-rw-r--r-- | inc/indexer.php | 4 |
1 files changed, 2 insertions, 2 deletions
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 |