From 726732244a5d51a0da54219174c13f4428017b79 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 8 Dec 2022 21:24:55 +0000 Subject: [PATCH] sort valid ws-es in relative --- src/helpers/MiscFunctions.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 9bd94a7c..e0dcb6dc 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -286,6 +286,8 @@ int getWorkspaceIDFromString(const std::string& in, std::string& outName) { validWSes.push_back(ws->m_iID); } + std::sort(validWSes.begin(), validWSes.end()); + // get the offset remains = remains < 0 ? -((-remains) % validWSes.size()) : remains % validWSes.size();