Replace an unnecessary null check with an assert; NFC

This commit is contained in:
Aaron Ballman 2021-08-20 12:04:09 -04:00
parent 2456e11614
commit 65bcdeaa15
1 changed files with 3 additions and 1 deletions

View File

@ -1219,8 +1219,10 @@ bool DeclContext::Encloses(const DeclContext *DC) const {
DeclContext *DeclContext::getNonTransparentContext() {
DeclContext *DC = this;
while (DC && DC->isTransparentContext())
while (DC->isTransparentContext()) {
DC = DC->getParent();
assert(DC && "All transparent contexts should have a parent!");
}
return DC;
}