Skip to content

Commit c9e9092

Browse files
AkkermanAkkerman
Akkerman
authored and
Akkerman
committed
NH-3777: Reverted TopologicalSorter to initial commit (which was broken because not all constraints were available)
1 parent 25dca03 commit c9e9092

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/NHibernate/Loader/TopologicalSorter.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,9 @@ private void eliminateNode(Node node)
8383

8484
private Node getNodeWithoutSuccessors()
8585
{
86-
// note: It would be more performant to check the nodes in reverse order, since that would allow decreases of "_nodeCount" in "eliminateNode"
87-
// as often as possible since high indices are preferred over low indices whenever there is a choice.
88-
// However, several test cases are violated if this change is made; It seems not all restrictions are properly added as edges here.
89-
for (int i = 0; i < _nodeCount; i++)
86+
// note: Check the nodes in reverse order, since that allows decreases of "_nodeCount" in "eliminateNode"
87+
// as often as possible because high indices are preferred over low indices whenever there is a choice.
88+
for (int i = _nodeCount - 1; i >= 0; i--)
9089
{
9190
var node = _nodes[i];
9291
if (node.Eliminated)

0 commit comments

Comments
 (0)