From 2bbdb1f30e3e0660bea731e14ca23dcbcbcac3af Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Sat, 26 Feb 2000 15:55:52 +0000 Subject: [PATCH] Fixed major performance problem with setscope. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@270 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/DOH/Doh/hash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SWIG/Source/DOH/Doh/hash.c b/SWIG/Source/DOH/Doh/hash.c index b9dae989f..36f1591b6 100644 --- a/SWIG/Source/DOH/Doh/hash.c +++ b/SWIG/Source/DOH/Doh/hash.c @@ -159,7 +159,8 @@ Hash_scope(DOH *ho, int s) { if (h->flags & DOH_FLAG_SETSCOPE) return; if (s < h->scope) h->scope = s; h->flags = h->flags | DOH_FLAG_SETSCOPE; - for (i = 0; i < h->hashsize; i++) { + if (h->scope != s) { + for (i = 0; i < h->hashsize; i++) { if ((n = h->hashtable[i])) { while (n) { Setscope(n->object,s); @@ -167,6 +168,7 @@ Hash_scope(DOH *ho, int s) { n = n->next; } } + } } h->flags = h->flags & ~DOH_FLAG_SETSCOPE; }