mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Deprecate VectorVal(VectorType*) ctora
Adds a new one taking an IntrusivePtr.
This commit is contained in:
parent
c5236ecaee
commit
d4dba40727
51 changed files with 171 additions and 160 deletions
|
@ -201,8 +201,8 @@ VectorVal* TopkVal::GetTopK(int k) const // returns vector
|
|||
|
||||
auto vector_index = make_intrusive<TypeList>(IntrusivePtr{NewRef{}, type});
|
||||
vector_index->Append({NewRef{}, type});
|
||||
VectorType* v = new VectorType(std::move(vector_index));
|
||||
VectorVal* t = new VectorVal(v);
|
||||
auto v = make_intrusive<VectorType>(std::move(vector_index));
|
||||
auto t = make_intrusive<VectorVal>(std::move(v));
|
||||
|
||||
// this does no estimation if the results is correct!
|
||||
// in any case - just to make this future-proof (and I am lazy) - this can return more than k.
|
||||
|
@ -228,8 +228,7 @@ VectorVal* TopkVal::GetTopK(int k) const // returns vector
|
|||
it--;
|
||||
}
|
||||
|
||||
Unref(v);
|
||||
return t;
|
||||
return t.release();
|
||||
}
|
||||
|
||||
uint64_t TopkVal::GetCount(Val* value) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue