Skip to content

Commit eace826

Browse files
committed
[clang] NFC, simplify the shouldLifetimeExtendThroughPath.
1 parent 2337789 commit eace826

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/lib/Sema/CheckExprLifetime.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,14 +1091,13 @@ enum PathLifetimeKind {
10911091
/// supposed to lifetime-extend along.
10921092
static PathLifetimeKind
10931093
shouldLifetimeExtendThroughPath(const IndirectLocalPath &Path) {
1094-
PathLifetimeKind Kind = PathLifetimeKind::Extend;
10951094
for (auto Elem : Path) {
10961095
if (Elem.Kind == IndirectLocalPathEntry::DefaultInit)
10971096
return PathLifetimeKind::Extend;
1098-
else if (Elem.Kind != IndirectLocalPathEntry::LambdaCaptureInit)
1097+
if (Elem.Kind != IndirectLocalPathEntry::LambdaCaptureInit)
10991098
return PathLifetimeKind::NoExtend;
11001099
}
1101-
return Kind;
1100+
return PathLifetimeKind::Extend;
11021101
}
11031102

11041103
/// Find the range for the first interesting entry in the path at or after I.

0 commit comments

Comments
 (0)