diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/cache.c | 4 | ||||
-rw-r--r-- | mbbsd/read.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 7059d4e2..cacdb1d7 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -509,10 +509,13 @@ void touchbtotal(int bid) { void touchdircache(int bid) { +#if DIRCACHESIZE int *i = (int *)&SHM->dircache[bid - 1][0].filename[0]; *i = 0; +#endif } +#if DIRCACHESIZE void load_fileheader_cache(int bid, char *direct) { @@ -553,6 +556,7 @@ get_fileheader_cache(int bid, char *direct, fileheader_t * headers, memcpy(headers, &(SHM->dircache[bid - 1][n]), sizeof(fileheader_t) * ret); return ret; } +#endif static int cmpboardname(boardheader_t ** brd, boardheader_t ** tmp) diff --git a/mbbsd/read.c b/mbbsd/read.c index 8ad1b32e..bcb596af 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -892,12 +892,14 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey recbase = 1; locmem->top_ln = recbase; } +#if DIRCACHESIZE if( bidcache > 0 && !(currmode & (MODE_SELECT | MODE_DIGEST)) && (last_line - recbase) < DIRCACHESIZE ) entries = get_fileheader_cache(currbid, currdirect, headers, recbase, p_lines); else +#endif entries = get_records(currdirect, headers, FHSZ, recbase, p_lines); } @@ -971,11 +973,13 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey } else if (reload) { recbase = locmem->top_ln; +#if DIRCACHESIZE if (bidcache > 0 && !(currmode & (MODE_SELECT | MODE_DIGEST)) && last_line - recbase < DIRCACHESIZE) entries = get_fileheader_cache(currbid, currdirect, headers, recbase, p_lines); else +#endif entries = get_records(currdirect, headers, FHSZ, recbase, p_lines); |