Initial Grease Pencil 3.0 stage #106848

Merged
Falk David merged 224 commits from filedescriptor/blender:grease-pencil-v3 into main 2023-05-30 11:14:22 +02:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit 992fea69e0 - Show all commits

View File

@ -424,10 +424,10 @@ bool Layer::overwrite_frame(int frame_number, GreasePencilFrame &&frame)
Span<int> Layer::sorted_keys() const
{
this->sorted_keys_cache_.ensure([&](Vector<int> &r_data) {
r_data.clear_and_shrink();
r_data.reserve(this->frames().size());
r_data.reinitialize(this->frames().size());

Any reason to call clear_and_shrink here? Might as well call reinitialize if not

Any reason to call `clear_and_shrink` here? Might as well call `reinitialize` if not
int i = 0;
for (int64_t key : this->frames().keys()) {
r_data.append(key);
r_data[i++] = key;
}
std::sort(r_data.begin(), r_data.end());
});