From: John McCall Date: Thu, 23 Jun 2011 21:18:31 +0000 (+0000) Subject: Apparently at some point in the past I forgot how 'continue' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b3f853c6f684c1df423e994482681844c396342;p=clang Apparently at some point in the past I forgot how 'continue' works in a 'while(false)' loop. Simplify this code; it was complicated only in anticipation of C++0x lambdas, and it can become complicated again when those happen. :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133761 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 1766d39c14..b8d3ec60d3 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -641,12 +641,8 @@ DeclContext *Decl::getNonClosureContext() { // This is basically "while (DC->isClosure()) DC = DC->getParent();" // except that it's significantly more efficient to cast to a known // decl type and call getDeclContext() than to call getParent(). - do { - if (isa(DC)) { - DC = cast(DC)->getDeclContext(); - continue; - } - } while (false); + while (isa(DC)) + DC = cast(DC)->getDeclContext(); assert(!DC->isClosure()); return DC;