mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Add templated As() method to Val, use in various places we were using dynamic_cast
This commit is contained in:
parent
a7b5915b1a
commit
a94fcad957
7 changed files with 28 additions and 14 deletions
|
@ -707,7 +707,7 @@ function str_smith_waterman%(s1: string, s2: string, params: sw_params%) : sw_su
|
|||
## .. zeek:see:: split_string split_string1 split_string_all split_string_n
|
||||
function str_split%(s: string, idx: index_vec%): string_vec &deprecated="Remove in v4.1. Use str_split_indices."
|
||||
%{
|
||||
auto idx_v = dynamic_cast<VectorVal*>(idx);
|
||||
auto idx_v = idx->As<VectorVal*>();
|
||||
auto n = idx_v->Size();
|
||||
zeek::String::IdxVec indices(n);
|
||||
unsigned int i;
|
||||
|
@ -746,7 +746,7 @@ function str_split%(s: string, idx: index_vec%): string_vec &deprecated="Remove
|
|||
## .. zeek:see:: split_string split_string1 split_string_all split_string_n
|
||||
function str_split_indices%(s: string, idx: index_vec%): string_vec
|
||||
%{
|
||||
auto idx_v = dynamic_cast<VectorVal*>(idx);
|
||||
auto idx_v = idx->As<VectorVal*>();
|
||||
auto n = idx_v->Size();
|
||||
zeek::String::IdxVec indices(n);
|
||||
unsigned int i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue