We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ba41c2 commit f2d87fdCopy full SHA for f2d87fd
src/gui/guiFormSpecMenu.cpp
@@ -3360,11 +3360,14 @@ 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
- // Have to be deterministic also for elements without spec
+ // The comparison has to be compatible with strict weak ordering
3364
if (spec_a && spec_b)
3365
return spec_a->priority < spec_b->priority;
3366
3367
- return a->getID() < b->getID();
+ if (spec_a && !spec_b)
3368
+ return true;
3369
+
3370
+ return false;
3371
});
3372
3373
// 3: Re-assign the pointers
0 commit comments