From 12b14276931d7f9ee6152e4e41cb6f36a887be60 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 24 Oct 2005 23:23:53 +0000 Subject: [PATCH] (ef_zapcache): Clearing the cache doesn't make sense. No harm done if the next user can't use the cache, it gets automatically zapped then. Remove. --- include/file.h | 1 - src/lib/common/file.c | 13 ------------- src/lib/subs/snxtitem.c | 7 ------- src/lib/subs/snxtsct.c | 3 --- 4 files changed, 24 deletions(-) diff --git a/include/file.h b/include/file.h index e63a5190..5654e2eb 100644 --- a/include/file.h +++ b/include/file.h @@ -141,7 +141,6 @@ extern int ef_flush(int); extern int ef_write(int, int, void *); extern int ef_extend(int, int); extern int ef_ensure_space(int, int, int); -extern void ef_zapcache(int); extern int ef_nelem(int); extern int ef_flags(int); extern int ef_byname(char *); diff --git a/src/lib/common/file.c b/src/lib/common/file.c index 0b924ebc..71164316 100644 --- a/src/lib/common/file.c +++ b/src/lib/common/file.c @@ -376,19 +376,6 @@ ef_extend(int type, int count) return i == count; } -/* - * Mark the cache for the file containing objects of type 'type' as unused. - */ -void -ef_zapcache(int type) -{ - struct empfile *ep = &empfile[type]; - if ((ep->flags & EFF_MEM) == 0) { - ep->cids = 0; - ep->baseid = -1; - } -} - struct castr * ef_cadef(int type) { diff --git a/src/lib/subs/snxtitem.c b/src/lib/subs/snxtitem.c index d3ba6bcc..2a505c66 100644 --- a/src/lib/subs/snxtitem.c +++ b/src/lib/subs/snxtitem.c @@ -134,7 +134,6 @@ snxtitem_area(struct nstr_item *np, int type, struct range *range) np->read = ef_read; np->flags = ef_flags(type); xysize_range(&np->range); - ef_zapcache(type); } void @@ -160,7 +159,6 @@ snxtitem_dist(struct nstr_item *np, int type, int cx, int cy, /* It did the wrong thing for small, hitech worlds. */ xysize_range(&np->range); #endif - ef_zapcache(type); } void @@ -176,7 +174,6 @@ snxtitem_xy(struct nstr_item *np, int type, coord x, coord y) np->dist = 0; np->read = ef_read; np->flags = ef_flags(type); - ef_zapcache(type); } void @@ -190,7 +187,6 @@ snxtitem_all(struct nstr_item *np, int type) np->read = ef_read; np->flags = ef_flags(type); xysize_range(&np->range); - ef_zapcache(type); } void @@ -207,7 +203,6 @@ snxtitem_group(struct nstr_item *np, int type, s_char group) np->read = ef_read; np->flags = ef_flags(type); xysize_range(&np->range); - ef_zapcache(type); } void @@ -215,7 +210,6 @@ snxtitem_rewind(struct nstr_item *np) { np->cur = -1; np->index = -1; - ef_zapcache(np->type); } int @@ -235,6 +229,5 @@ snxtitem_list(struct nstr_item *np, int type, int *list, int len) for (i = 0; i < len; i++) np->list[i] = list[i]; np->size = len; - ef_zapcache(type); return 1; } diff --git a/src/lib/subs/snxtsct.c b/src/lib/subs/snxtsct.c index c4e0baec..ff7d2eca 100644 --- a/src/lib/subs/snxtsct.c +++ b/src/lib/subs/snxtsct.c @@ -115,7 +115,6 @@ snxtsct_area(struct nstr_sect *np, struct range *range) np->dx = -1; np->dy = 0; xysize_range(&np->range); - ef_zapcache(EF_SECTOR); } void @@ -126,7 +125,6 @@ snxtsct_rewind(struct nstr_sect *np) np->dx = -1; np->dy = 0; np->id = -1; - ef_zapcache(EF_SECTOR); } void @@ -149,7 +147,6 @@ snxtsct_dist(struct nstr_sect *np, coord cx, coord cy, int dist) /* It was not doing the right thing when the world was small */ xysize_range(&np->range); #endif - ef_zapcache(EF_SECTOR); } void