Fixed major performance problem with setscope.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@270 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-02-26 15:55:52 +00:00
commit 2bbdb1f30e

View file

@ -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;
}