mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
streamlining of expressions only used for script optimization
This commit is contained in:
parent
f557b40d14
commit
16b2946fef
2 changed files with 3 additions and 17 deletions
|
@ -2083,7 +2083,8 @@ bool RecordCoerceExpr::WillTransform(Reducer* c) const { return op->Tag() == EXP
|
|||
ExprPtr RecordCoerceExpr::Reduce(Reducer* c, StmtPtr& red_stmt) {
|
||||
if ( WillTransform(c) ) {
|
||||
auto rt = cast_intrusive<RecordType>(type);
|
||||
auto rc_op = op->AsRecordConstructorExpr();
|
||||
ASSERT(op->Tag() == EXPR_RECORD_CONSTRUCTOR);
|
||||
auto rc_op = static_cast<const RecordConstructorExpr*>(op.get());
|
||||
auto known_constr = with_location_of(make_intrusive<RecordConstructorExpr>(rt, rc_op->Op()), this);
|
||||
auto red_e = known_constr->Reduce(c, red_stmt);
|
||||
return TransformMe(std::move(red_e), c, red_stmt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue