Skip to content

Commit aa85e35

Browse files
Keemosty12orizi
andauthored
semantic/cache: dedupe FixedSizeArray const size id (#9851)
Co-authored-by: Ori Ziv <oriz@starkware.co>
1 parent 78f8078 commit aa85e35

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

  • crates/cairo-lang-semantic/src/cache

crates/cairo-lang-semantic/src/cache/mod.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ enum TypeCached {
11471147
Snapshot(TypeIdCached),
11481148
GenericParameter(GenericParamCached),
11491149
ImplType(ImplTypeCached),
1150-
FixedSizeArray(TypeIdCached, ConstValueCached),
1150+
FixedSizeArray(TypeIdCached, ConstValueIdCached),
11511151
ClosureType(ClosureTypeCached),
11521152
Coupon(SemanticFunctionIdCached),
11531153
}
@@ -1170,7 +1170,7 @@ impl TypeCached {
11701170
}
11711171
TypeLongId::FixedSizeArray { type_id, size } => TypeCached::FixedSizeArray(
11721172
TypeIdCached::new(type_id, ctx),
1173-
ConstValueCached::new(size.long(ctx.db).clone(), ctx),
1173+
ConstValueIdCached::new(size, ctx),
11741174
),
11751175
TypeLongId::Closure(closure_ty) => {
11761176
TypeCached::ClosureType(ClosureTypeCached::new(closure_ty, ctx))
@@ -1194,10 +1194,9 @@ impl TypeCached {
11941194
generic_param.get_embedded(&ctx.defs_loading_data, ctx.db),
11951195
),
11961196
TypeCached::ImplType(impl_type) => TypeLongId::ImplType(impl_type.embed(ctx)),
1197-
TypeCached::FixedSizeArray(type_id, size) => TypeLongId::FixedSizeArray {
1198-
type_id: type_id.embed(ctx),
1199-
size: size.embed(ctx).intern(ctx.db),
1200-
},
1197+
TypeCached::FixedSizeArray(type_id, size) => {
1198+
TypeLongId::FixedSizeArray { type_id: type_id.embed(ctx), size: size.embed(ctx) }
1199+
}
12011200
TypeCached::ClosureType(closure_ty) => TypeLongId::Closure(closure_ty.embed(ctx)),
12021201
TypeCached::Coupon(coupon) => TypeLongId::Coupon(coupon.embed(ctx)),
12031202
}

0 commit comments

Comments
 (0)