mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
Remove GET_FIELD_AS macro, replace with template methods
This commit is contained in:
parent
a94fcad957
commit
4962986df1
15 changed files with 61 additions and 53 deletions
|
@ -109,19 +109,19 @@ Substring::Vec* Substring::VecFromPolicy(VectorVal* vec)
|
|||
if ( ! v )
|
||||
continue;
|
||||
|
||||
const String* str = v->AsRecordVal()->GetStringField(0);
|
||||
const String* str = v->AsRecordVal()->GetFieldAs<StringVal>(0);
|
||||
auto* substr = new Substring(*str);
|
||||
|
||||
const VectorVal* aligns = v->AsRecordVal()->GetField(1)->AsVectorVal();
|
||||
for ( unsigned int j = 1; j <= aligns->Size(); ++j )
|
||||
{
|
||||
const RecordVal* align = aligns->AsVectorVal()->At(j)->AsRecordVal();
|
||||
const String* str = align->GetStringField(0);
|
||||
int index = align->GetCountField(1);
|
||||
const String* str = align->GetFieldAs<StringVal>(0);
|
||||
int index = align->GetFieldAs<CountVal>(1);
|
||||
substr->AddAlignment(str, index);
|
||||
}
|
||||
|
||||
bool new_alignment = v->AsRecordVal()->GetBoolField(2);
|
||||
bool new_alignment = v->AsRecordVal()->GetFieldAs<BoolVal>(2);
|
||||
substr->MarkNewAlignment(new_alignment);
|
||||
|
||||
result->push_back(substr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue