Type: return IntrusivePtr

This commit is contained in:
Max Kellermann 2020-03-02 19:33:49 +01:00
parent 0a6ddfb6b5
commit ba35ebec4c
38 changed files with 319 additions and 334 deletions

View file

@ -184,11 +184,11 @@ void TopkVal::Merge(const TopkVal* value, bool doPrune)
}
}
Val* TopkVal::DoClone(CloneState* state)
IntrusivePtr<Val> TopkVal::DoClone(CloneState* state)
{
auto clone = new TopkVal(size);
auto clone = make_intrusive<TopkVal>(size);
clone->Merge(this);
return state->NewClone(this, clone);
return state->NewClone(this, std::move(clone));
}
VectorVal* TopkVal::GetTopK(int k) const // returns vector