OSDN Git Service

Add comment
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Dec 2000 06:09:44 +0000 (06:09 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Dec 2000 06:09:44 +0000 (06:09 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38525 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/pt.c

index 29047d7..cc18eef 100644 (file)
@@ -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);
          }