enigma-dev / RadialGM

A native IDE for ENIGMA written in C++ using the Qt Framework.
GNU General Public License v3.0
46 stars 22 forks source link

Tree Drag and Drop Move #147

Closed RobertBColton closed 3 years ago

RobertBColton commented 4 years ago

This is just a tiny tweak that I'm not sure if we should go with. It changes the drag and drop for the tree model so that if you drag and drop into the same parent it only does a move inside the repeated field instead of extracting and reinserting it, which is redundant when it's the same repeated field. I'm not sure if this is even an optimization, I think it might be, because the documentation says ExtractSubrange can have quadratic behavior but I don't know if there's also any deep copying going on. https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.repeated_field#RepeatedPtrField.ExtractSubrange.details