summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-10 21:18:07 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-10 21:18:07 +0800
commitb9d50d84ccc8c070c7e38f2a9dcd1f3bb5641df5 (patch)
treee8272b4de36a873e61c40473f3b7c7a077b0500d /mbbsd
parentf63fd767f682e9eb4d5a2ca37c5884e4a5441b12 (diff)
downloadpttbbs-b9d50d84ccc8c070c7e38f2a9dcd1f3bb5641df5.tar
pttbbs-b9d50d84ccc8c070c7e38f2a9dcd1f3bb5641df5.tar.gz
pttbbs-b9d50d84ccc8c070c7e38f2a9dcd1f3bb5641df5.tar.bz2
pttbbs-b9d50d84ccc8c070c7e38f2a9dcd1f3bb5641df5.tar.lz
pttbbs-b9d50d84ccc8c070c7e38f2a9dcd1f3bb5641df5.tar.xz
pttbbs-b9d50d84ccc8c070c7e38f2a9dcd1f3bb5641df5.tar.zst
pttbbs-b9d50d84ccc8c070c7e38f2a9dcd1f3bb5641df5.zip
HOTBOARDCACHE
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1584 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/board.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index 9821edc5..3a47b0ed 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -543,6 +543,14 @@ load_boards(char *key)
byMALLOC = 0;
needREALLOC = (get_data_number(fav) != brdnum);
}
+#if HOTBOARDCACHE
+ else if( class_bid == -1 ){
+ nbrd = (boardstat_t *)malloc(sizeof(boardstat_t) * SHM->nHOTs);
+ for( i = 0 ; i < SHM->nHOTs ; ++i )
+ addnewbrdstat(SHM->HBcache[i] - SHM->bcache,
+ Ben_Perm(SHM->HBcache[i]));
+ }
+#endif
else { // general case
nbrd = (boardstat_t *) MALLOC(sizeof(boardstat_t) * numboards);
for (i = 0; i < numboards; i++) {
@@ -550,10 +558,13 @@ load_boards(char *key)
continue;
n = (int)(bptr - bcache);
if (!bptr->brdname[0] ||
- (bptr->brdattr & BRD_GROUPBOARD) ||
- !((state = Ben_Perm(bptr)) || (currmode & MODE_MENU)) ||
- (key[0] && !strcasestr(bptr->title, key)) ||
- (class_bid == -1 && bptr->nuser < 5))
+ (bptr->brdattr & BRD_GROUPBOARD) ||
+ !((state = Ben_Perm(bptr)) || (currmode & MODE_MENU)) ||
+ (key[0] && !strcasestr(bptr->title, key))
+#ifndef HOTBOARDCACHE
+ || (class_bid == -1 && bptr->nuser < 5)
+#endif
+ )
continue;
addnewbrdstat(n, state);
}
@@ -564,9 +575,10 @@ load_boards(char *key)
#endif
needREALLOC = 1;
}
+#ifndef HOTBOARDCACHE
if (class_bid == -1)
qsort(nbrd, brdnum, sizeof(boardstat_t), cmpboardfriends);
-
+#endif
} else { /* load boards of a subclass */
int childcount = bptr->childcount;
nbrd = (boardstat_t *) malloc(childcount * sizeof(boardstat_t));