Deprecate VectorVal(VectorType*) ctora

Adds a new one taking an IntrusivePtr.
This commit is contained in:
Jon Siwek 2020-05-09 12:01:03 -07:00
parent c5236ecaee
commit d4dba40727
51 changed files with 171 additions and 160 deletions

View file

@ -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