Skip to content

Commit 87ac257

Browse files
committed
Hoist check outside of lambda (NFC)
1 parent 78d6c42 commit 87ac257

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lldb/source/Target/Target.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,9 +2719,6 @@ llvm::Optional<SwiftScratchContextReader> Target::GetSwiftScratchContext(
27192719

27202720
auto get_or_create_fallback_context =
27212721
[&]() -> TypeSystemSwiftTypeRefForExpressions * {
2722-
if (!lldb_module || !m_use_scratch_typesystem_per_module)
2723-
return nullptr;
2724-
27252722
ModuleLanguage idx = {lldb_module, lldb::eLanguageTypeSwift};
27262723
auto cached = m_scratch_typesystem_for_module.find(idx);
27272724
if (cached != m_scratch_typesystem_for_module.end()) {
@@ -2794,7 +2791,9 @@ llvm::Optional<SwiftScratchContextReader> Target::GetSwiftScratchContext(
27942791
return typesystem_sp.get();
27952792
};
27962793

2797-
auto *swift_scratch_ctx = get_or_create_fallback_context();
2794+
TypeSystemSwiftTypeRefForExpressions *swift_scratch_ctx = nullptr;
2795+
if (lldb_module && m_use_scratch_typesystem_per_module)
2796+
swift_scratch_ctx = get_or_create_fallback_context();
27982797
if (!swift_scratch_ctx) {
27992798
if (log)
28002799
log->Printf("returned project-wide scratch context\n");

0 commit comments

Comments
 (0)