Branch: Tag:

2002-06-06

2002-06-06 16:26:00 by Martin Stjernholm <mast@lysator.liu.se>

Did away with a loop that typically caused very bad time complexity
when cleaning up after a failed compilation. Fixes [bug 2792 (#2792)].

Rev: src/las.c:1.293

5:   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.292 2002/06/03 12:25:18 grubba Exp $"); + RCSID("$Id: las.c,v 1.293 2002/06/06 16:26:00 mast Exp $");      #include "language.h"   #include "interpret.h"
372:   #undef BLOCK_ALLOC_NEXT   #define BLOCK_ALLOC_NEXT u.node.a    + #undef PRE_INIT_BLOCK + #define PRE_INIT_BLOCK(NODE) do { \ +  NODE->token = USHRT_MAX; \ +  } while (0) +    BLOCK_ALLOC(node_s, NODES)      #undef BLOCK_ALLOC_NEXT
575:    {    for(e=0;e<NODES;e++)    { -  for(tmp=free_node_ss;tmp;tmp=_CAR(tmp)) -  if(tmp==tmp2->x+e) -  break; -  -  if(!tmp) +  if (tmp2->x[e].token != USHRT_MAX)    {    tmp=tmp2->x+e;   #ifdef PIKE_DEBUG