about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-11-23 10:32:24 +0100
committerMarijn Haverbeke <marijnh@gmail.com>2011-11-23 11:02:27 +0100
commitacbc4aa9f8f46545c8c11422c62b392e3ef64cf5 (patch)
treed2494335413cb5d4bc29896dfa9c0b92e5635150
parenta8dd52ed3649d2dba3474a80254d1cc5180797f3 (diff)
Remove deep scope traversal in revoke_clean
It is not needed anymore.
-rw-r--r--src/comp/middle/trans_common.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/comp/middle/trans_common.rs b/src/comp/middle/trans_common.rs
index 55518c027e1..c99b6197c83 100644
--- a/src/comp/middle/trans_common.rs
+++ b/src/comp/middle/trans_common.rs
@@ -297,14 +297,8 @@ fn revoke_clean(cx: @block_ctxt, val: ValueRef) {
         }
         i += 1;
     }
-    // The value does not have a cleanup associated with it. Continue to next
-    // scope.
-    if found == -1 {
-        alt sc_cx.parent {
-          parent_some(parent) { revoke_clean(parent, val); } _ {}
-        }
-        ret;
-    }
+    // The value does not have a cleanup associated with it.
+    if found == -1 { ret; }
     // We found the cleanup and remove it
     sc_cx.cleanups =
         std::vec::slice(sc_cx.cleanups, 0u, found as uint) +