Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
b67e50d5
Commit
b67e50d5
authored
Jun 29, 2015
by
Robert McGibbon
Browse files
Sort plugins by length of filename before loading
parent
7be6e8fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
olla/src/Platform.cpp
olla/src/Platform.cpp
+5
-0
No files found.
olla/src/Platform.cpp
View file @
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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment