Skip to content

Commit acbc4aa

Browse files
committed
Remove deep scope traversal in revoke_clean
It is not needed anymore.
1 parent a8dd52e commit acbc4aa

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/comp/middle/trans_common.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,8 @@ fn revoke_clean(cx: @block_ctxt, val: ValueRef) {
297297
}
298298
i += 1;
299299
}
300-
// The value does not have a cleanup associated with it. Continue to next
301-
// scope.
302-
if found == -1 {
303-
alt sc_cx.parent {
304-
parent_some(parent) { revoke_clean(parent, val); } _ {}
305-
}
306-
ret;
307-
}
300+
// The value does not have a cleanup associated with it.
301+
if found == -1 { ret; }
308302
// We found the cleanup and remove it
309303
sc_cx.cleanups =
310304
std::vec::slice(sc_cx.cleanups, 0u, found as uint) +

0 commit comments

Comments
 (0)