Initial Grease Pencil 3.0 stage #106848
|
@ -424,10 +424,10 @@ bool Layer::overwrite_frame(int frame_number, GreasePencilFrame &&frame)
|
||||||
Span<int> Layer::sorted_keys() const
|
Span<int> Layer::sorted_keys() const
|
||||||
{
|
{
|
||||||
this->sorted_keys_cache_.ensure([&](Vector<int> &r_data) {
|
this->sorted_keys_cache_.ensure([&](Vector<int> &r_data) {
|
||||||
r_data.clear_and_shrink();
|
r_data.reinitialize(this->frames().size());
|
||||||
|
|||||||
r_data.reserve(this->frames().size());
|
int i = 0;
|
||||||
for (int64_t key : this->frames().keys()) {
|
for (int64_t key : this->frames().keys()) {
|
||||||
r_data.append(key);
|
r_data[i++] = key;
|
||||||
}
|
}
|
||||||
std::sort(r_data.begin(), r_data.end());
|
std::sort(r_data.begin(), r_data.end());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Any reason to call
clear_and_shrink
here? Might as well callreinitialize
if not