diff --git a/src/generate.cpp b/src/generate.cpp index ae37ba5d..8cd73504 100644 --- a/src/generate.cpp +++ b/src/generate.cpp @@ -147,7 +147,7 @@ void SolveSpaceUI::GenerateAll(Generate type, bool andFindFree, bool genForBBox) SK.groupOrder.Clear(); for(int i = 0; i < SK.group.n; i++) SK.groupOrder.Add(&SK.group.elem[i].h); - std::sort(&SK.groupOrder.elem[0], &SK.groupOrder.elem[SK.groupOrder.n], + std::sort(SK.groupOrder.begin(), SK.groupOrder.end(), [](const hGroup &ha, const hGroup &hb) { return SK.GetGroup(ha)->order < SK.GetGroup(hb)->order; }); diff --git a/src/system.cpp b/src/system.cpp index e90611a9..85d439ff 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -105,9 +105,7 @@ void System::SolveBySubstitution() { if(IsDragged(a)) { // A is being dragged, so A should stay, and B should go - hParam t = a; - a = b; - b = t; + std::swap(a, b); } int j;