mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Use STL functionality to initialize coercion map
This commit is contained in:
parent
8782894d7d
commit
a7fcc7a5d8
1 changed files with 1 additions and 4 deletions
|
@ -3778,12 +3778,9 @@ RecordCoerceExpr::RecordCoerceExpr(ExprPtr arg_op, RecordTypePtr r)
|
|||
RecordType* sub_r = op->GetType()->AsRecordType();
|
||||
|
||||
int map_size = t_r->NumFields();
|
||||
map.reserve(map_size);
|
||||
map.resize(map_size, -1); // -1 = field is not mapped
|
||||
|
||||
int i;
|
||||
for ( i = 0; i < map_size; ++i )
|
||||
map.emplace_back(-1); // -1 = field is not mapped
|
||||
|
||||
for ( i = 0; i < sub_r->NumFields(); ++i )
|
||||
{
|
||||
int t_i = t_r->FieldOffset(sub_r->FieldName(i));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue