diff --git a/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp b/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp index 6b8ec573d0690..5c584ca779a37 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp @@ -1911,7 +1911,6 @@ SwiftASTContext *TypeSystemSwiftTypeRefForExpressions::GetSwiftASTContext( SwiftASTContext *TypeSystemSwiftTypeRef::GetSwiftASTContextOrNull( const SymbolContext &sc) const { std::lock_guard guard(m_swift_ast_context_lock); - const char *key = nullptr; auto it = m_swift_ast_context_map.find(key); if (it != m_swift_ast_context_map.end()) @@ -1921,9 +1920,9 @@ SwiftASTContext *TypeSystemSwiftTypeRef::GetSwiftASTContextOrNull( SwiftASTContext *TypeSystemSwiftTypeRefForExpressions::GetSwiftASTContextOrNull( const SymbolContext &sc) const { - std::lock_guard guard(m_swift_ast_context_lock); - const char *key = DeriveKeyFor(sc); + + std::lock_guard guard(m_swift_ast_context_lock); auto it = m_swift_ast_context_map.find(key); if (it != m_swift_ast_context_map.end()) return llvm::cast_or_null(it->second.typesystem.get());