Avoid cloning Name when looking up function and class types (#14092)

This commit is contained in:
Micha Reiser 2024-11-04 15:52:59 +01:00 committed by GitHub
parent a7a78f939c
commit bc0586d922
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 4 deletions

View file

@ -856,7 +856,7 @@ impl<'db> TypeInferenceBuilder<'db> {
};
let function_ty = Type::FunctionLiteral(FunctionType::new(
self.db,
name.id.clone(),
&*name.id,
function_kind,
definition,
decorator_tys,
@ -965,7 +965,7 @@ impl<'db> TypeInferenceBuilder<'db> {
let class_ty = Type::ClassLiteral(ClassType::new(
self.db,
name.id.clone(),
&*name.id,
definition,
body_scope,
maybe_known_class,