X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Ftermlists.c;h=6c8549597d9dde33301c5fa7737a20acd892edc2;hb=77b4d51d81340f3374ae8a97aea0177a0fbcd336;hp=e586169bdf2184d764f2fa2f2d7c5e44fa6bc3e4;hpb=b1d1bd7c6dbf7af16d5047d91b39827d9a8c4252;p=pazpar2-moved-to-github.git diff --git a/src/termlists.c b/src/termlists.c index e586169..6c85495 100644 --- a/src/termlists.c +++ b/src/termlists.c @@ -1,5 +1,5 @@ /* - * $Id: termlists.c,v 1.2 2007-01-08 12:43:41 adam Exp $ + * $Id: termlists.c,v 1.3 2007-01-08 18:32:35 quinn Exp $ */ #include @@ -88,7 +88,7 @@ static void update_highscore(struct termlist *tl, struct termlist_score *t) int smallest; int me = -1; - if (t->frequency < tl->highscore_min) + if (tl->highscore_num > tl->highscore_size && t->frequency < tl->highscore_min) return; smallest = 0; @@ -101,6 +101,8 @@ static void update_highscore(struct termlist *tl, struct termlist_score *t) } if (tl->highscore_num) tl->highscore_min = tl->highscore[smallest]->frequency; + if (t->frequency < tl->highscore_min) + tl->highscore_min = t->frequency; if (me >= 0) return; if (tl->highscore_num < tl->highscore_size)