We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a8aca6 commit 3b67e73Copy full SHA for 3b67e73
src/gui/guiFormSpecMenu.cpp
@@ -3360,8 +3360,11 @@ void GUIFormSpecMenu::legacySortElements(std::list<IGUIElement *>::iterator from
3360
// TODO: getSpecByID is a linear search. It should made O(1), or cached here.
3361
const FieldSpec *spec_a = getSpecByID(a->getID());
3362
const FieldSpec *spec_b = getSpecByID(b->getID());
3363
- return spec_a && spec_b &&
3364
- spec_a->priority < spec_b->priority;
+ // Have to be deterministic also for elements without spec
+ if (spec_a && spec_b)
3365
+ return spec_a->priority < spec_b->priority;
3366
+
3367
+ return a->getID() < b->getID();
3368
});
3369
3370
// 3: Re-assign the pointers
0 commit comments