From 96b2ce64c0ad586b9a7a1dc5e5582c706fbcd5e8 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Thu, 20 Nov 2008 23:33:05 +0000 Subject: [PATCH] Helgrind's event-map garbage collector hammers VG_(OSetGen_Next). Import an optimisation from the analogous function in m_wordfm.c. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8795 --- coregrind/m_oset.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/coregrind/m_oset.c b/coregrind/m_oset.c index 980d054fda..b213597faf 100644 --- a/coregrind/m_oset.c +++ b/coregrind/m_oset.c @@ -751,15 +751,17 @@ void* VG_(OSetGen_Next)(AvlTree* t) // keeping this loop in this simpler form. while (stackPop(t, &n, &i)) { switch (i) { - case 1: + case 1: case_1: stackPush(t, n, 2); - if (n->left) stackPush(t, n->left, 1); + /* if (n->left) stackPush(t, n->left, 1); */ + if (n->left) { n = n->left; goto case_1; } break; case 2: stackPush(t, n, 3); return elem_of_node(n); case 3: - if (n->right) stackPush(t, n->right, 1); + /* if (n->right) stackPush(t, n->right, 1); */ + if (n->right) { n = n->right; goto case_1; } break; } } -- 2.47.3