Avoid unneeded allocations

This commit is contained in:
Ayaz Hafiz 2022-10-18 13:53:15 -05:00
parent c4f9aa6fe6
commit 6edab8b7cc
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -701,8 +701,8 @@ fn synthesize_derived_hash<'a>(
// Hash.hash hasher payload
let call_member = alloc_expr(ast::Expr::Apply(
alloc_expr(ast::Expr::Var {
module_name: env.arena.alloc_str("Hash"),
ident: env.arena.alloc_str("hash"),
module_name: "Hash",
ident: "hash",
}),
&*env.arena.alloc([
&*alloc_expr(ast::Expr::Var {
@ -757,8 +757,8 @@ fn synthesize_derived_is_eq<'a>(
// Bool.isEq payload1 payload2
let call_member = alloc_expr(ast::Expr::Apply(
alloc_expr(ast::Expr::Var {
module_name: env.arena.alloc_str("Bool"),
ident: env.arena.alloc_str("isEq"),
module_name: "Bool",
ident: "isEq",
}),
&*env.arena.alloc([
&*alloc_expr(ast::Expr::Var {