"vscode:/vscode.git/clone" did not exist on "a8d1ccd5249bf8d2b6e499006f0195f4f3b772b0"
Commit 47f2af23 authored by peastman's avatar peastman
Browse files

Merge pull request #997 from rmcgibbo/sort-order

Sort plugins by length of filename before loading
parents 071f2f81 b67e50d5
......@@ -45,6 +45,7 @@
#include <cstdlib>
#endif
#include <set>
#include <algorithm>
#include "ReferencePlatform.h"
......@@ -52,6 +53,9 @@ using namespace OpenMM;
using namespace std;
std::vector<std::string> Platform::pluginLoadFailures;
static bool stringLengthComparator(string i, string j) {
return (i.size() < j.size());
}
static int registerPlatforms() {
......@@ -269,6 +273,7 @@ vector<string> Platform::loadPluginsFromDirectory(const string& directory) {
#endif
vector<string> loadedLibraries;
pluginLoadFailures.resize(0);
std::sort (files.begin(), files.end(), stringLengthComparator);
for (unsigned int i = 0; i < files.size(); ++i) {
try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment