From: Chris Hanson Date: Tue, 14 Aug 2001 01:15:05 +0000 (+0000) Subject: Add optimization to link_variables so that it does nothing if the X-Git-Tag: 20090517-FFI~2603 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4ca9ba899f723385bcc1eb900e3be2f446cf06e2;p=mit-scheme.git Add optimization to link_variables so that it does nothing if the variables are already linked. --- 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)