From 7e7d95175604e98bd3d23134f6d708d87a66b5ed Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Fri, 29 Dec 2000 06:09:44 +0000 Subject: [PATCH] Add comment From-SVN: r38525 --- gcc/cp/pt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 29047d7306b..cc18eef4ac9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3962,10 +3962,14 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope) if (comp_template_args (TREE_PURPOSE (*tp), arglist)) { found = *tp; + + /* Use the move-to-front heuristic to speed up future + searches. */ *tp = TREE_CHAIN (*tp); TREE_CHAIN (found) = DECL_TEMPLATE_INSTANTIATIONS (template); DECL_TEMPLATE_INSTANTIATIONS (template) = found; + return TREE_VALUE (found); } -- 2.30.2