another special-cased list type bites the dust and is replaced by the quicklist.

This commit is contained in:
Enno Rehling 2011-02-25 07:47:35 -08:00
parent 5497875c93
commit 5e21579036
2 changed files with 6 additions and 15 deletions

View File

@ -29,6 +29,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <util/attrib.h> #include <util/attrib.h>
#include <util/language.h> #include <util/language.h>
#include <util/log.h> #include <util/log.h>
#include <util/quicklist.h>
#include <util/rng.h> #include <util/rng.h>
#include <util/storage.h> #include <util/storage.h>
@ -254,7 +255,7 @@ attrib_type at_countdown = {
void void
age_borders(void) age_borders(void)
{ {
border_list * deleted = NULL; quicklist * deleted = NULL, *ql;
int i; int i;
for (i=0;i!=BORDER_MAXHASH;++i) { for (i=0;i!=BORDER_MAXHASH;++i) {
@ -264,22 +265,17 @@ age_borders(void)
for (;b;b=b->next) { for (;b;b=b->next) {
if (b->type->age) { if (b->type->age) {
if (b->type->age(b)==AT_AGE_REMOVE) { if (b->type->age(b)==AT_AGE_REMOVE) {
border_list * kill = malloc(sizeof(border_list)); ql_push(&deleted, b);
kill->data = b;
kill->next = deleted;
deleted = kill;
} }
} }
} }
} }
} }
while (deleted) { for (ql=deleted,i=0;ql;ql_advance(&ql, &i, 1)) {
border_list * blist = deleted->next; connection * b = (connection *)ql_get(ql, i);
connection * b = deleted->data;
erase_border(b); erase_border(b);
free(deleted);
deleted = blist;
} }
ql_free(deleted);
} }
/******** /********

View File

@ -36,11 +36,6 @@ extern "C" {
unsigned int id; /* unique id */ unsigned int id; /* unique id */
} connection; } connection;
typedef struct border_list {
struct border_list * next;
struct connection * data;
} border_list;
typedef struct border_type { typedef struct border_type {
const char* __name; /* internal use only */ const char* __name; /* internal use only */
variant_type datatype; variant_type datatype;