Skip to content

Commit f2a6f10

Browse files
committed
Address comments to improve readability
1 parent 1824674 commit f2a6f10

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clang/include/clang/AST/Decl.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3116,11 +3116,12 @@ class FieldDecl : public DeclaratorDecl, public Mergeable<FieldDecl> {
31163116
/// Returns the index of this field within its record,
31173117
/// as appropriate for passing to ASTRecordLayout::getFieldOffset.
31183118
unsigned getFieldIndex() const {
3119-
const FieldDecl *C = getCanonicalDecl();
3120-
if (C->CachedFieldIndex == 0)
3121-
C->setCachedFieldIndex();
3122-
assert(C->CachedFieldIndex);
3123-
return C->CachedFieldIndex - 1;
3119+
const FieldDecl *Canonical = getCanonicalDecl();
3120+
if (Canonical->CachedFieldIndex == 0) {
3121+
Canonical->setCachedFieldIndex();
3122+
assert(Canonical->CachedFieldIndex != 0);
3123+
}
3124+
return Canonical->CachedFieldIndex - 1;
31243125
}
31253126

31263127
private:

0 commit comments

Comments
 (0)