Work on issue #112.

If two conflicting records had the same number of override form IDs,
their order was dependent on the order in which they were in the graph,
which is undefined, so I added a lexicographical comparison to resolve
that.

Testers reported that it didn't fix the issue though.
This commit is contained in:
WrinklyNinja
2014-02-17 22:42:01 +00:00
parent 55185e531a
commit dc17abb41b
+11 -2
View File
@@ -224,10 +224,19 @@ namespace boss {
continue;
vertex_t vertex, parentVertex;
if (graph[*vit].NumOverrideFormIDs() >= graph[*vit2].NumOverrideFormIDs()) {
if (graph[*vit].NumOverrideFormIDs() > graph[*vit2].NumOverrideFormIDs()) {
parentVertex = *vit;
vertex = *vit2;
} else {
}
else if (graph[*vit].NumOverrideFormIDs() < graph[*vit2].NumOverrideFormIDs()) {
parentVertex = *vit2;
vertex = *vit;
}
else if (graph[*vit].Name() < graph[*vit2].Name()) { //There needs to be an edge between the two, but direction cannot be decided using overlap size. Just use names.
parentVertex = *vit;
vertex = *vit2;
}
else {
parentVertex = *vit2;
vertex = *vit;
}