mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
directly construct records of known types, rather than requiring coercion
This commit is contained in:
parent
d165db6909
commit
9a429808ab
6 changed files with 81 additions and 12 deletions
|
@ -1827,7 +1827,14 @@ ExprPtr HasFieldExpr::Duplicate()
|
|||
ExprPtr RecordConstructorExpr::Duplicate()
|
||||
{
|
||||
auto op_l = op->Duplicate()->AsListExprPtr();
|
||||
return SetSucc(new RecordConstructorExpr(op_l));
|
||||
|
||||
if ( map )
|
||||
{
|
||||
auto rt = cast_intrusive<RecordType>(type);
|
||||
return SetSucc(new RecordConstructorExpr(rt, op_l));
|
||||
}
|
||||
else
|
||||
return SetSucc(new RecordConstructorExpr(op_l));
|
||||
}
|
||||
|
||||
bool RecordConstructorExpr::HasReducedOps(Reducer* c) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue