resolved a slow path introduced in commit db6bee26 / r1406 ( rebuild xctx-<inst[].color after undo/load )

This commit is contained in:
Stefan Frederik 2020-12-20 02:09:38 +01:00
parent a737e53be4
commit 63a6a8767e
2 changed files with 12 additions and 8 deletions

View File

@ -991,12 +991,12 @@ void draw_hilight_net(int on_window)
{
int save_draw;
int i,c;
struct hilight_hashentry *entry;
double x1,y1,x2,y2;
xSymbol *symptr;
int use_hash;
struct wireentry *wireptr;
struct instentry *instanceptr;
struct hilight_hashentry *entry;
if(!xctx->hilight_nets) return;
dbg(3, "draw_hilight_net(): xctx->prep_hi_structs=%d\n", xctx->prep_hi_structs);
@ -1045,7 +1045,6 @@ void draw_hilight_net(int on_window)
if(use_hash) init_inst_iterator(x1, y1, x2, y2);
else i = -1;
while(1) {
char *type;
if(use_hash) {
if( !(instanceptr = inst_iterator_next())) break;
i = instanceptr->n;
@ -1054,12 +1053,6 @@ void draw_hilight_net(int on_window)
i++;
if(i >= xctx->instances) break;
}
type = (xctx->inst[i].ptr+ xctx->sym)->type;
/* after an undo xctx->inst[i].color is gone, so rebuild it for labels/pins */
if( type && xctx->inst[i].color == 0 && IS_LABEL_SH_OR_PIN(type) ) {
entry=bus_hilight_lookup(xctx->inst[i].lab, 0, XLOOKUP);
if(entry) xctx->inst[i].color = get_color(entry->value);
}
if(xctx->inst[i].color )
{
symptr = (xctx->inst[i].ptr+ xctx->sym);

View File

@ -631,6 +631,7 @@ void prepare_netlist_structs(int for_netlist)
double rx1,ry1;
struct wireentry *wptr;
struct instpinentry *iptr;
struct hilight_hashentry *entry;
int i,j, rects, generic_rects;
char *dir=NULL;
char *type=NULL;
@ -1041,6 +1042,16 @@ void prepare_netlist_structs(int for_netlist)
my_free(840, &class);
my_free(841, &global_node);
dbg(2, "prepare_netlist_structs(): returning\n");
if(xctx->hilight_nets) for(i=0;i<xctx->instances;i++){
/* after an undo/load/hierarchy descend/return
* xctx->inst[i].color is gone, so rebuild it for labels/pins */
char *type = (xctx->inst[i].ptr+ xctx->sym)->type;
if(type && xctx->inst[i].color == 0 && IS_LABEL_SH_OR_PIN(type) ) {
entry=bus_hilight_lookup(xctx->inst[i].lab, 0, XLOOKUP);
if(entry) xctx->inst[i].color = get_color(entry->value);
}
}
}
int sym_vs_sch_pins()