From 4ca9ba899f723385bcc1eb900e3be2f446cf06e2 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 14 Aug 2001 01:15:05 +0000 Subject: [PATCH] Add optimization to link_variables so that it does nothing if the variables are already linked. --- v7/src/microcode/lookup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/v7/src/microcode/lookup.c b/v7/src/microcode/lookup.c index 3710a9397..6eda3f47c 100644 --- a/v7/src/microcode/lookup.c +++ b/v7/src/microcode/lookup.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: lookup.c,v 9.64 2001/08/07 01:26:29 cph Exp $ +$Id: lookup.c,v 9.65 2001/08/14 01:15:05 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -549,6 +549,9 @@ link_variables (SCHEME_OBJECT target_environment, SCHEME_OBJECT target_symbol, if (source_kind == TRAP_COMPILER_CACHED) { SCHEME_OBJECT source_cache = (GET_TRAP_CACHE (*source_cell)); + if (source_cache == target_cache) + /* Already linked. */ + return (PRIM_DONE); GC_CHECK (((count_references (GET_CACHE_OPERATOR_REFERENCES (target_cache))) * SPACE_PER_UUO_LINK) -- 2.25.1